summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>2016-11-03 16:27:16 -0700
committerVaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>2016-11-03 16:28:31 -0700
commit6ce2d706397d78a7b4e013c3192c4dc33a9364c8 (patch)
tree6bc8d5218a16a83c5d8fc477d7b5064afb7b8df5 /drivers
parent758693b4a6d94a0724081578d24f6ba1cc449255 (diff)
msm: vidc: Update mbs per second calculation
When operating rate is less than fps, the behavior is undefined. For better user experience use the max value of fps and operating rate to scale the clocks. CRs-Fixed: 959695 Change-Id: I57aa3e8b4987cb1adf9fad514a1fd1e84d44ac3f Signed-off-by: Vaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/msm/vidc/msm_vidc_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index e612c6ed11c7..816b72b154de 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -298,6 +298,11 @@ static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst)
rc = msm_comm_g_ctrl(inst, &ctrl);
if (!rc && ctrl.value) {
fps = (ctrl.value >> 16) ? ctrl.value >> 16 : 1;
+ /*
+ * Check if operating rate is less than fps.
+ * If Yes, then use fps to scale clocks
+ */
+ fps = fps > inst->prop.fps ? fps : inst->prop.fps;
return max(output_port_mbs, capture_port_mbs) * fps;
} else
return max(output_port_mbs, capture_port_mbs) * inst->prop.fps;