diff mbox series

[v1] drm/i915/selftests: Correct frequency handling in RPS power measurement

Message ID 20250108044858.3825662-1-sk.anirban@intel.com (mailing list archive)
State New
Headers show
Series [v1] drm/i915/selftests: Correct frequency handling in RPS power measurement | expand

Commit Message

Anirban, Sk Jan. 8, 2025, 4:48 a.m. UTC
From: Sk Anirban <sk.anirban@intel.com>

Fix the frequency calculation by ensuring it is adjusted
only once during power measurement. Update live_rps_power test
to use the correct frequency values for logging and comparison.

Signed-off-by: Sk Anirban <sk.anirban@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_rps.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Riana Tauro Jan. 8, 2025, 10:37 a.m. UTC | #1
On 1/8/2025 10:18 AM, sk.anirban@intel.com wrote:
> From: Sk Anirban <sk.anirban@intel.com>
> 
> Fix the frequency calculation by ensuring it is adjusted
adjusted?
"Fix the frequency calculation during power measurement"
should be enough
> only once during power measurement. Update live_rps_power test
> to use the correct frequency values for logging and comparison.
> 
> Signed-off-by: Sk Anirban <sk.anirban@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/selftest_rps.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
> index c207a4fb03bf..d65135dfd80e 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rps.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
> @@ -1126,6 +1126,7 @@ static u64 measure_power_at(struct intel_rps *rps, int *freq)
>   {
>   	*freq = rps_set_check(rps, *freq);
>   	msleep(100);
> +	*freq = intel_gpu_freq(rps, *freq);
>   	return measure_power(rps, freq);
>   }
>   
> @@ -1202,13 +1203,13 @@ int live_rps_power(void *arg)
>   
>   		pr_info("%s: min:%llumW @ %uMHz, max:%llumW @ %uMHz\n",
>   			engine->name,
> -			min.power, intel_gpu_freq(rps, min.freq),
> -			max.power, intel_gpu_freq(rps, max.freq));
> +			min.power, min.freq,
> +			max.power, max.freq);
>   
>   		if (10 * min.freq >= 9 * max.freq) {
>   			pr_notice("Could not control frequency, ran at [%d:%uMHz, %d:%uMhz]\n",
> -				  min.freq, intel_gpu_freq(rps, min.freq),
> -				  max.freq, intel_gpu_freq(rps, max.freq));
> +				  min.freq, min.freq,
> +				  max.freq, max.freq);
You don't have to print this twice.


With the above fixed
Reviewed-by: Riana Tauro <riana.tauro@intel.com>
>   			continue;
>   		}
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/selftest_rps.c b/drivers/gpu/drm/i915/gt/selftest_rps.c
index c207a4fb03bf..d65135dfd80e 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rps.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rps.c
@@ -1126,6 +1126,7 @@  static u64 measure_power_at(struct intel_rps *rps, int *freq)
 {
 	*freq = rps_set_check(rps, *freq);
 	msleep(100);
+	*freq = intel_gpu_freq(rps, *freq);
 	return measure_power(rps, freq);
 }
 
@@ -1202,13 +1203,13 @@  int live_rps_power(void *arg)
 
 		pr_info("%s: min:%llumW @ %uMHz, max:%llumW @ %uMHz\n",
 			engine->name,
-			min.power, intel_gpu_freq(rps, min.freq),
-			max.power, intel_gpu_freq(rps, max.freq));
+			min.power, min.freq,
+			max.power, max.freq);
 
 		if (10 * min.freq >= 9 * max.freq) {
 			pr_notice("Could not control frequency, ran at [%d:%uMHz, %d:%uMhz]\n",
-				  min.freq, intel_gpu_freq(rps, min.freq),
-				  max.freq, intel_gpu_freq(rps, max.freq));
+				  min.freq, min.freq,
+				  max.freq, max.freq);
 			continue;
 		}