[PATCH] drm/i915/rc6: Print RC0 & RC6 freq in RC6 selftest

sk.anirban at intel.com sk.anirban at intel.com
Fri Aug 23 12:40:31 UTC 2024


From: Sk Anirban <sk.anirban at intel.com>

Get actual requency while running selftests.

Signed-off-by: Sk Anirban <sk.anirban at intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_rc6.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
index 1aa1446c8fb0..f6cc90cd6984 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
@@ -9,7 +9,7 @@
 #include "intel_gt_requests.h"
 #include "intel_ring.h"
 #include "selftest_rc6.h"
-
+#include "intel_rps.h"
 #include "selftests/i915_random.h"
 #include "selftests/librapl.h"
 
@@ -28,6 +28,7 @@ static u64 rc6_residency(struct intel_rc6 *rc6)
 	return result;
 }
 
+
 int live_rc6_manual(void *arg)
 {
 	struct intel_gt *gt = arg;
@@ -63,6 +64,9 @@ int live_rc6_manual(void *arg)
 	dt = ktime_get();
 	rc0_power = librapl_energy_uJ();
 	msleep(1000);
+	struct intel_rps *rps = &gt->rps;
+	u32 freq = intel_rps_read_actual_frequency(rps);
+	pr_info("GPU Freq: %u in RC0\n", freq);
 	rc0_power = librapl_energy_uJ() - rc0_power;
 	dt = ktime_sub(ktime_get(), dt);
 	res[1] = rc6_residency(rc6);
@@ -91,6 +95,9 @@ int live_rc6_manual(void *arg)
 	dt = ktime_get();
 	rc6_power = librapl_energy_uJ();
 	msleep(100);
+	rps = &gt->rps;
+	freq = intel_rps_read_actual_frequency(rps);
+	pr_info("GPU Freq: %u in RC6\n", freq);
 	rc6_power = librapl_energy_uJ() - rc6_power;
 	dt = ktime_sub(ktime_get(), dt);
 	res[1] = rc6_residency(rc6);
@@ -252,3 +259,6 @@ int live_rc6_ctx_wa(void *arg)
 	kfree(engines);
 	return err;
 }
+
+
+
-- 
2.34.1



More information about the Intel-gfx-trybot mailing list