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

Commit 7b39e847 authored by Shivendra Kakrania's avatar Shivendra Kakrania Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Update clock calculations for a video session



Clock configurations are updated for a video session.
These configurations are needed to scale clocks optimally to
achieve best performance.

Change-Id: Ic335490d026645bf0a349fe70e02574b55ed594d
CRs-Fixed: 2181935
Signed-off-by: default avatarShivendra Kakrania <shiven@codeaurora.org>
parent fdd12c2c
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -567,6 +567,9 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst,
			inst->clk_data.entry->vpp_cycles;
			inst->clk_data.entry->vpp_cycles;


		vpp_cycles = mbs_per_second * vpp_cycles_per_mb;
		vpp_cycles = mbs_per_second * vpp_cycles_per_mb;
		/* 21 / 20 is overhead factor */
		vpp_cycles = (vpp_cycles * 21)/
				(inst->clk_data.work_route * 20);


		vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles;
		vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles;


@@ -574,8 +577,12 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst,
		vsp_cycles += (inst->clk_data.bitrate * 10) / 7;
		vsp_cycles += (inst->clk_data.bitrate * 10) / 7;
	} else if (inst->session_type == MSM_VIDC_DECODER) {
	} else if (inst->session_type == MSM_VIDC_DECODER) {
		vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles;
		vpp_cycles = mbs_per_second * inst->clk_data.entry->vpp_cycles;
		/* 21 / 20 is overhead factor */
		vpp_cycles = (vpp_cycles * 21)/
				(inst->clk_data.work_route * 20);


		vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles;
		vsp_cycles = mbs_per_second * inst->clk_data.entry->vsp_cycles;

		/* 10 / 7 is overhead factor */
		/* 10 / 7 is overhead factor */
		vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7;
		vsp_cycles += ((inst->prop.fps * filled_len * 8) * 10) / 7;