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

Commit cbde86ea authored by Nilaan Gunabalachandran's avatar Nilaan Gunabalachandran
Browse files

disp: msm: sde: add tracking for if perf_mode is changed



Perf tuning mode can be updated through debugfs and this should
be used to reflect the core clock rate.

Change-Id: I313d079f0b8013f43f4b293c6400f34eaf56b6d2
Signed-off-by: default avatarNilaan Gunabalachandran <ngunabal@codeaurora.org>
parent df172c1e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -842,12 +842,18 @@ static void _sde_core_perf_crtc_update_check(struct drm_crtc *crtc,
		}
	}

	if (kms->perf.perf_tune.mode_changed &&
			kms->perf.perf_tune.min_core_clk)
		new->core_clk_rate = kms->perf.perf_tune.min_core_clk;

	if ((params_changed &&
			(new->core_clk_rate > old->core_clk_rate)) ||
			(!params_changed && new->core_clk_rate &&
			(new->core_clk_rate < old->core_clk_rate))) {
			(new->core_clk_rate < old->core_clk_rate)) ||
			kms->perf.perf_tune.mode_changed) {
		old->core_clk_rate = new->core_clk_rate;
		*update_clk = 1;
		kms->perf.perf_tune.mode_changed = false;
	}
}

@@ -1069,6 +1075,7 @@ static ssize_t _sde_core_perf_mode_write(struct file *file,
		DRM_INFO("normal performance mode\n");
	}
	perf->perf_tune.mode = perf_mode;
	perf->perf_tune.mode_changed = true;

	return count;
}
+3 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _SDE_CORE_PERF_H_
@@ -47,11 +47,13 @@ struct sde_core_perf_params {
 * @mode: performance mode
 * @min_core_clk: minimum core clock
 * @min_bus_vote: minimum bus vote
 * @mode_changed: indicate if clock tuning strategy changed
 */
struct sde_core_perf_tune {
	u32 mode;
	u64 min_core_clk;
	u64 min_bus_vote;
	bool mode_changed;
};

/**