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

Commit 45815884 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Update mbs per second calculation"

parents ad57fa09 8ff5fe2f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -245,7 +245,8 @@ enum multi_stream msm_comm_get_stream_output_mode(struct msm_vidc_inst *inst)
static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst)
{
	int output_port_mbs, capture_port_mbs;
	int fps, rc;
	int rc;
	u32 fps;
	struct v4l2_control ctrl;

	output_port_mbs = NUM_MBS_PER_FRAME(inst->prop.width[OUTPUT_PORT],
@@ -257,6 +258,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 the clocks
		*/
		fps = max(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;