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

Commit 0fb5c58c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Force nominal for high bitrate decode usecases"

parents e53fcca8 2efb0193
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -679,6 +679,7 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
	u32 operating_rate, vsp_factor_num = 1, vsp_factor_den = 1;
	u32 base_cycles = 0;
	u32 codec = 0;
	u64 bitrate = 0;

	core = inst->core;
	dcvs = &inst->clk_data;
@@ -768,7 +769,8 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
		codec = get_v4l2_codec(inst);
		base_cycles = inst->has_bframe ?
				80 : inst->clk_data.entry->vsp_cycles;
		vsp_cycles = fps * filled_len * 8;
		bitrate = fps * filled_len * 8;
		vsp_cycles = bitrate;

		if (codec == V4L2_PIX_FMT_VP9) {
			vsp_cycles = div_u64(vsp_cycles * 170, 100);
@@ -786,6 +788,11 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,

		vsp_cycles += mbs_per_second * base_cycles;

		if (codec == V4L2_PIX_FMT_VP9 &&
		    inst->clk_data.work_mode == HFI_WORKMODE_2 &&
		    inst->clk_data.work_route == 4 &&
			bitrate > 90000000)
			vsp_cycles = msm_vidc_max_freq(inst->core, inst->sid);
	} else {
		s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
		return msm_vidc_max_freq(inst->core, inst->sid);