msm: vidc: fix BW overvote due to wrong worst_cf in fbd

For worst complexity factor received in fbd, also need
to divide it by frame_size, otherwise will cause
bus BW overvote.

Change-Id: Ibb20103c4ab8e3830eea8cf8a04b32f421b60362
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
This commit is contained in:
Qiwei Liu 2020-11-03 13:27:13 +08:00
parent a9c461984c
commit af73385543

View File

@ -2652,6 +2652,9 @@ static void handle_fbd(enum hal_command_response cmd, void *data)
}
if (inst->core->resources.ubwc_stats_in_fbd == 1) {
u32 frame_size =
(msm_vidc_get_mbs_per_frame(inst) / (32 * 8) * 3) / 2;
mutex_lock(&inst->ubwc_stats_lock);
inst->ubwc_stats.is_valid =
fill_buf_done->ubwc_cr_stat.is_valid;
@ -2659,6 +2662,8 @@ static void handle_fbd(enum hal_command_response cmd, void *data)
fill_buf_done->ubwc_cr_stat.worst_cr;
inst->ubwc_stats.worst_cf =
fill_buf_done->ubwc_cr_stat.worst_cf;
if (frame_size)
inst->ubwc_stats.worst_cf /= frame_size;
mutex_unlock(&inst->ubwc_stats_lock);
}