Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ce2d706 authored by Vaibhav Deshu Venkatesh's avatar Vaibhav Deshu Venkatesh
Browse files

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: default avatarVaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>
parent 758693b4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;