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

Commit 48c12f7d authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: fix high framerate video usecase issue



High framerate (480fps) video usecase needs more
clock frequency for video hardware and hence increase
clock frequency by considering firmware clock cycles
as well.

Change-Id: I3dcb9c4fadd5f91d9874a3e963c30e7eb74da7ab
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent a60934ca
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -685,7 +685,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst,
	u32 filled_len)
{
	unsigned long freq = 0;
	unsigned long vpp_cycles = 0, vsp_cycles = 0;
	unsigned long vpp_cycles = 0, vsp_cycles = 0, fw_cycles = 0;
	u32 vpp_cycles_per_mb;
	u32 mbs_per_second;
	struct msm_vidc_core *core = NULL;
@@ -704,7 +704,7 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst,
	fps = msm_vidc_get_fps(inst);

	/*
	 * Calculate vpp, vsp cycles separately for encoder and decoder.
	 * Calculate vpp, vsp, fw cycles separately for encoder and decoder.
	 * Even though, most part is common now, in future it may change
	 * between them.
	 */
@@ -729,6 +729,9 @@ static unsigned long msm_vidc_calc_freq(struct msm_vidc_inst *inst,
		}
		vsp_cycles += ((u64)inst->clk_data.bitrate * vsp_factor_num) /
				vsp_factor_den;

		fw_cycles = fps * inst->core->resources.fw_cycles;

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

		fw_cycles = fps * inst->core->resources.fw_cycles;

	} else {
		dprintk(VIDC_ERR, "Unknown session type = %s\n", __func__);
		return msm_vidc_max_freq(inst->core);
	}

	freq = max(vpp_cycles, vsp_cycles);
	freq = max(freq, fw_cycles);

	dprintk(VIDC_DBG, "Update DCVS Load\n");
	allowed_clks_tbl = core->resources.allowed_clks_tbl;
+4 −0
Original line number Diff line number Diff line
@@ -243,6 +243,10 @@ static struct msm_vidc_common_data sm8150_common_data[] = {
		.key = "qcom,dcvs",
		.value = 1,
	},
	{
		.key = "qcom,fw-cycles",
		.value = 760000,
	},
};

static struct msm_vidc_common_data sdm845_common_data[] = {
+2 −0
Original line number Diff line number Diff line
@@ -791,6 +791,8 @@ int read_platform_resources_from_drv_data(
			"qcom,decode-batching");
	res->dcvs = find_key_value(platform_data,
			"qcom,dcvs");
	res->fw_cycles = find_key_value(platform_data,
			"qcom,fw-cycles");

	res->csc_coeff_data = &platform_data->csc_data;

+1 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ struct msm_vidc_platform_resources {
	struct msm_vidc_csc_coeff *csc_coeff_data;
	struct msm_vidc_mem_cdsp mem_cdsp;
	uint32_t vpu_ver;
	uint32_t fw_cycles;
};

static inline bool is_iommu_present(struct msm_vidc_platform_resources *res)