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

Commit 390f7a41 authored by Praneeth Paladugu's avatar Praneeth Paladugu Committed by Sowmya Pandiri
Browse files

msm: vidc: Disable DCVS when Turbo mode is enabled



When clients enabled Turbo mode, it is expected that Venus runs
at Turbo frequency. But due to DCVS it may go to Nominal which is
different from clients expectation. Hence disable DCVS when Turbo
mode is enabled.

Change-Id: Ia95b55cdc93af599e7cb1930b72ba9bd60b23a96
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: default avatarSowmya Pandiri <spandiri@codeaurora.org>
parent 095c42a3
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ static void msm_comm_generate_session_error(struct msm_vidc_inst *inst);
static void msm_comm_generate_sys_error(struct msm_vidc_inst *inst);
static void handle_session_error(enum hal_command_response cmd, void *data);

static inline bool is_turbo_session(struct msm_vidc_inst *inst)
bool msm_comm_turbo_session(struct msm_vidc_inst *inst)
{
	return !!(inst->flags & VIDC_TURBO);
}
@@ -122,7 +122,7 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst,
			load = 0;
	}

	if (is_turbo_session(inst)) {
	if (msm_comm_turbo_session(inst)) {
		if (!(quirks & LOAD_CALC_IGNORE_TURBO_LOAD))
			load = inst->core->resources.max_load;
	}
@@ -304,7 +304,7 @@ static int msm_comm_vote_bus(struct msm_vidc_core *core)
		vote_data[i].width = inst->prop.width[CAPTURE_PORT];
		vote_data[i].height = inst->prop.height[CAPTURE_PORT];
		vote_data[i].fps = inst->prop.fps;
		if (is_turbo_session(inst))
		if (msm_comm_turbo_session(inst))
			vote_data[i].power_mode = VIDC_POWER_TURBO;
		else if (is_low_power_session(inst))
			vote_data[i].power_mode = VIDC_POWER_LOW;
@@ -2337,7 +2337,7 @@ static void msm_vidc_print_running_insts(struct msm_vidc_core *core)
			if (is_thumbnail_session(temp))
				strlcat(properties, "N", sizeof(properties));

			if (is_turbo_session(temp))
			if (msm_comm_turbo_session(temp))
				strlcat(properties, "T", sizeof(properties));

			dprintk(VIDC_ERR, "%4d|%4d|%4d|%4d|%4s\n",
+1 −0
Original line number Diff line number Diff line
@@ -86,4 +86,5 @@ int msm_comm_set_color_format(struct msm_vidc_inst *inst,
int msm_comm_g_ctrl(struct msm_vidc_inst *inst, int id);
void msm_comm_cleanup_internal_buffers(struct msm_vidc_inst *inst);
int msm_vidc_comm_s_parm(struct msm_vidc_inst *inst, struct v4l2_streamparm *a);
bool msm_comm_turbo_session(struct msm_vidc_inst *inst);
#endif
+4 −2
Original line number Diff line number Diff line
@@ -507,7 +507,8 @@ static int msm_dcvs_check_supported(struct msm_vidc_inst *inst)
	dcvs = &inst->dcvs;
	instance_count = msm_dcvs_count_active_instances(core);

	if (instance_count == 1 && inst->session_type == MSM_VIDC_DECODER) {
	if (instance_count == 1 && inst->session_type == MSM_VIDC_DECODER &&
		!msm_comm_turbo_session(inst)) {
		num_mbs_per_frame = msm_dcvs_get_mbs_per_frame(inst);
		output_buf_req = get_buff_req_buffer(inst,
			msm_comm_get_hal_output_buffer(inst));
@@ -533,7 +534,8 @@ static int msm_dcvs_check_supported(struct msm_vidc_inst *inst)
			return -EINVAL;
		}
	} else if (instance_count == 1 &&
			inst->session_type == MSM_VIDC_ENCODER) {
			inst->session_type == MSM_VIDC_ENCODER &&
			!msm_comm_turbo_session(inst)) {
		if (!msm_dcvs_enc_check(inst) ||
			!inst->dcvs.is_additional_buff_added)
			return -ENOTSUPP;