Merge "video: driver: adding encoder GOP awareness settings in the power calculation"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
b12f5ec06e
@@ -244,7 +244,7 @@ static u32 av1_num_tiles_pineapple[7][3] =
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* 1000x */
|
/* 1000x */
|
||||||
static u32 pineapple_en_readfactor[7] = {1000, 1500, 1750, 1875, 1000, 2000, 2000};
|
static u32 pineapple_en_readfactor[8] = {1000, 1500, 1750, 1875, 1000, 2000, 2000, 1000};
|
||||||
/* 1000x */
|
/* 1000x */
|
||||||
static u32 pineapple_en_writefactor[7] = {1000, 500, 500, 500, 1000, 0, 1000};
|
static u32 pineapple_en_writefactor[8] = {1000, 500, 500, 500, 1000, 0, 1000, 1000};
|
||||||
static u32 pineapple_en_frame_num_parallel = 1;
|
static u32 pineapple_en_frame_num_parallel = 1;
|
||||||
|
@@ -704,7 +704,7 @@ static int calculate_bandwidth_encoder_iris33(
|
|||||||
codec_output->collocated_rd_wr_total_noc;
|
codec_output->collocated_rd_wr_total_noc;
|
||||||
|
|
||||||
/* I frame only */
|
/* I frame only */
|
||||||
if (codec_input.hierachical_layer == 7) {
|
if (codec_input.hierachical_layer == CODEC_GOP_IONLY) {
|
||||||
codec_output->collocated_rd_noc = 0;
|
codec_output->collocated_rd_noc = 0;
|
||||||
codec_output->collocated_wr_noc = 0;
|
codec_output->collocated_wr_noc = 0;
|
||||||
codec_output->collocated_rd_ddr = 0;
|
codec_output->collocated_rd_ddr = 0;
|
||||||
@@ -817,7 +817,7 @@ static int calculate_bandwidth_encoder_iris33(
|
|||||||
0 : codec_output->dpb_wr_noc;
|
0 : codec_output->dpb_wr_noc;
|
||||||
|
|
||||||
/* I frame only */
|
/* I frame only */
|
||||||
if (codec_input.hierachical_layer == 7) {
|
if (codec_input.hierachical_layer == CODEC_GOP_IONLY) {
|
||||||
codec_output->dpb_rd_y_noc = 0;
|
codec_output->dpb_rd_y_noc = 0;
|
||||||
codec_output->dpb_rd_crcb_noc =0;
|
codec_output->dpb_rd_crcb_noc =0;
|
||||||
codec_output->dpb_rdwr_duetooverlap_noc =0;
|
codec_output->dpb_rdwr_duetooverlap_noc =0;
|
||||||
|
@@ -19,6 +19,32 @@ static u64 __calculate_encoder(struct vidc_bus_vote_data *d);
|
|||||||
static u64 __calculate(struct msm_vidc_inst* inst, struct vidc_bus_vote_data *d);
|
static u64 __calculate(struct msm_vidc_inst* inst, struct vidc_bus_vote_data *d);
|
||||||
static u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size);
|
static u64 msm_vidc_calc_freq_iris33_legacy(struct msm_vidc_inst *inst, u32 data_size);
|
||||||
|
|
||||||
|
|
||||||
|
static int msm_vidc_get_hier_layer_val(struct msm_vidc_inst *inst)
|
||||||
|
{
|
||||||
|
int hierachical_layer = CODEC_GOP_IPP;
|
||||||
|
|
||||||
|
if (inst->domain == MSM_VIDC_ENCODER) {
|
||||||
|
if (inst->capabilities->cap[ALL_INTRA].value) {
|
||||||
|
/* no P and B frames case */
|
||||||
|
hierachical_layer = CODEC_GOP_IONLY;
|
||||||
|
} else if (inst->capabilities->cap[B_FRAME].value == 0) {
|
||||||
|
/* no B frames case */
|
||||||
|
hierachical_layer = CODEC_GOP_IPP;
|
||||||
|
} else { /* P and B frames enabled case */
|
||||||
|
if (inst->capabilities->cap[ENH_LAYER_COUNT].value == 0 ||
|
||||||
|
inst->capabilities->cap[ENH_LAYER_COUNT].value == 1)
|
||||||
|
hierachical_layer = CODEC_GOP_IbP;
|
||||||
|
else if (inst->capabilities->cap[ENH_LAYER_COUNT].value == 2)
|
||||||
|
hierachical_layer = CODEC_GOP_I1B2b1P;
|
||||||
|
else
|
||||||
|
hierachical_layer = CODEC_GOP_I3B4b1P;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hierachical_layer;
|
||||||
|
}
|
||||||
|
|
||||||
static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_size,
|
static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_size,
|
||||||
struct api_calculation_input *codec_input)
|
struct api_calculation_input *codec_input)
|
||||||
{
|
{
|
||||||
@@ -83,15 +109,8 @@ static int msm_vidc_init_codec_input_freq(struct msm_vidc_inst *inst, u32 data_s
|
|||||||
else
|
else
|
||||||
codec_input->bitdepth = CODEC_BITDEPTH_10;
|
codec_input->bitdepth = CODEC_BITDEPTH_10;
|
||||||
|
|
||||||
/*
|
codec_input->hierachical_layer =
|
||||||
* Used for calculating Encoder GOP Complexity
|
msm_vidc_get_hier_layer_val(inst);
|
||||||
* hierachical_layer=0..7 used as Array Index
|
|
||||||
* inst->capabilities->cap[B_FRAME].value=[ 0 1 2 ]
|
|
||||||
* TODO how to map?
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* set as IPP */
|
|
||||||
codec_input->hierachical_layer = 0;
|
|
||||||
|
|
||||||
if (inst->domain == MSM_VIDC_DECODER)
|
if (inst->domain == MSM_VIDC_DECODER)
|
||||||
color_fmt = v4l2_colorformat_to_driver(inst,
|
color_fmt = v4l2_colorformat_to_driver(inst,
|
||||||
@@ -177,12 +196,8 @@ static int msm_vidc_init_codec_input_bus(struct msm_vidc_inst *inst, struct vidc
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
codec_input->hierachical_layer =
|
||||||
* Used for calculating Encoder GOP Complexity
|
msm_vidc_get_hier_layer_val(inst);
|
||||||
* hierachical_layer=0..7 used as Array Index
|
|
||||||
* TODO how to map?
|
|
||||||
*/
|
|
||||||
codec_input->hierachical_layer = 0; /* set as IPP */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the calculated motion_vector_complexity is > 2 then set the
|
* If the calculated motion_vector_complexity is > 2 then set the
|
||||||
|
Reference in New Issue
Block a user