From a588ad882def235f899b2427ad86b8185eba6656 Mon Sep 17 00:00:00 2001 From: Johnny Liu Date: Thu, 24 Aug 2023 03:52:16 +0000 Subject: [PATCH] drm/tegra: Derive count weight from max freq The original resume_freq will be overridden when the device is put into suspend mode. Therefore, the resume cycle won't always use the max frequency of the device to set the actmon count weight. Change the implementation to use scaling_max_freq to always use the max frequency of the device to set the actmon count weight. Bug 4252125 Signed-off-by: Johnny Liu Change-Id: Iaaae8ada989cd1ed7dd728fb526ad4391a2f192c Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2967098 Reviewed-by: Mikko Perttunen GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/nvdec.c | 2 +- drivers/gpu/drm/tegra/nvenc.c | 2 +- drivers/gpu/drm/tegra/nvjpg.c | 2 +- drivers/gpu/drm/tegra/vic.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c index 40f12aac..44fcf166 100644 --- a/drivers/gpu/drm/tegra/nvdec.c +++ b/drivers/gpu/drm/tegra/nvdec.c @@ -588,7 +588,7 @@ static __maybe_unused int nvdec_runtime_resume(struct device *dev) nvdec_actmon_reg_init(nvdec); - nvdec_count_weight_init(nvdec, nvdec->devfreq->resume_freq); + nvdec_count_weight_init(nvdec, nvdec->devfreq->scaling_max_freq); host1x_actmon_enable(&nvdec->client.base); diff --git a/drivers/gpu/drm/tegra/nvenc.c b/drivers/gpu/drm/tegra/nvenc.c index a9b8f4ce..517c6dc0 100644 --- a/drivers/gpu/drm/tegra/nvenc.c +++ b/drivers/gpu/drm/tegra/nvenc.c @@ -478,7 +478,7 @@ static __maybe_unused int nvenc_runtime_resume(struct device *dev) nvenc_actmon_reg_init(nvenc); - nvenc_count_weight_init(nvenc, nvenc->devfreq->resume_freq); + nvenc_count_weight_init(nvenc, nvenc->devfreq->scaling_max_freq); host1x_actmon_enable(&nvenc->client.base); diff --git a/drivers/gpu/drm/tegra/nvjpg.c b/drivers/gpu/drm/tegra/nvjpg.c index 8daa55c3..c48aa58b 100644 --- a/drivers/gpu/drm/tegra/nvjpg.c +++ b/drivers/gpu/drm/tegra/nvjpg.c @@ -477,7 +477,7 @@ static __maybe_unused int nvjpg_runtime_resume(struct device *dev) nvjpg_actmon_reg_init(nvjpg); - nvjpg_count_weight_init(nvjpg, nvjpg->devfreq->resume_freq); + nvjpg_count_weight_init(nvjpg, nvjpg->devfreq->scaling_max_freq); host1x_actmon_enable(&nvjpg->client.base); diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index d184a253..932c9653 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -535,7 +535,7 @@ static int __maybe_unused vic_runtime_resume(struct device *dev) vic_actmon_reg_init(vic); - vic_count_weight_init(vic, vic->devfreq->resume_freq); + vic_count_weight_init(vic, vic->devfreq->scaling_max_freq); host1x_actmon_enable(&vic->client.base);