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

Commit e6a44aae authored by Suprith Malligere Shankaregowda's avatar Suprith Malligere Shankaregowda Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Fix DCVS enablement



DCVS feature depends on multiple client configurations.
Low latency, thumbnail mode, etc are few among them.
DCVS is now decided before the session starts streaming
i.e after all configuration are inplace. And disable
DCVS if disabled in DT.

CRs-Fixed: 2457035
Change-Id: I8b502ae237c248bd2fa6d3afc77212abff3628f7
Signed-off-by: default avatarSuprith Malligere Shankaregowda <supgow@codeaurora.org>
parent 0a42b676
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1228,6 +1228,8 @@ static inline int start_streaming(struct msm_vidc_inst *inst)
		__func__, inst->batch.enable ? "enabled" : "disabled",
		inst, hash32_ptr(inst->session));

	msm_dcvs_try_enable(inst);

	/*
	 * For seq_changed_insufficient, driver should set session_continue
	 * to firmware after the following sequence
@@ -1960,7 +1962,6 @@ void *msm_vidc_open(int core_id, int session_type)
		goto fail_init;
	}

	msm_dcvs_try_enable(inst);
	if (msm_comm_check_for_inst_overload(core)) {
		dprintk(VIDC_ERR,
			"Instance count reached Max limit, rejecting session");
+5 −3
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1015,15 +1015,17 @@ int msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst)

int msm_dcvs_try_enable(struct msm_vidc_inst *inst)
{
	if (!inst) {
	if (!inst || !inst->core) {
		dprintk(VIDC_ERR, "%s: Invalid args: %p\n", __func__, inst);
		return -EINVAL;
	}

	if (msm_vidc_clock_voting ||
			!inst->core->resources.dcvs ||
			inst->flags & VIDC_THUMBNAIL ||
			inst->clk_data.low_latency_mode ||
			inst->batch.enable) {
			inst->batch.enable ||
			inst->grid_enable) {
		dprintk(VIDC_PROF, "DCVS disabled: %pK\n", inst);
		inst->clk_data.dcvs_mode = false;
		return false;