Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/xe_pmu: Ensure consistent GPU frequency comparison
@ 2025-05-20 17:16 sk.anirban
  2025-05-20 20:26 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: sk.anirban @ 2025-05-20 17:16 UTC (permalink / raw)
  To: igt-dev
  Cc: anshuman.gupta, badal.nilawar, riana.tauro, karthik.poosa,
	ravi.kishore.koppuravuri, vinay.belgaumkar, Sk Anirban

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

Fetch the minimum frequency only once during GPU frequency restoration.
This avoids inconsistencies caused by potential changes in the minimum
frequency between multiple fetches.

Signed-off-by: Sk Anirban <sk.anirban@intel.com>
---
 tests/intel/xe_pmu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
index c49cceff5..f830c5de8 100644
--- a/tests/intel/xe_pmu.c
+++ b/tests/intel/xe_pmu.c
@@ -390,6 +390,7 @@ static void test_gt_frequency(int fd, struct drm_xe_engine_class_instance *eci)
 	uint32_t gt = eci->gt_id;
 	uint32_t orig_min = xe_gt_get_freq(fd, eci->gt_id, "min");
 	uint32_t orig_max = xe_gt_get_freq(fd, eci->gt_id, "max");
+	uint32_t current_min;
 	uint32_t orig_rpe;
 	uint32_t vm;
 	int pmu_fd[2];
@@ -440,8 +441,8 @@ static void test_gt_frequency(int fd, struct drm_xe_engine_class_instance *eci)
 	 */
 	igt_assert(xe_gt_set_freq(fd, gt, "min", orig_min) > 0);
 	orig_rpe = xe_gt_get_freq(fd, gt, "rpe");
-	igt_assert(xe_gt_get_freq(fd, gt, "min") == orig_min ||
-		   xe_gt_get_freq(fd, gt, "min") == orig_rpe);
+	current_min = xe_gt_get_freq(fd, gt, "min");
+	igt_assert(current_min == orig_min || current_min == orig_rpe);
 
 	igt_info("Minimum frequency: requested %.1f, actual %.1f\n",
 		 min[0], min[1]);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-05-23  8:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-20 17:16 [PATCH] tests/xe_pmu: Ensure consistent GPU frequency comparison sk.anirban
2025-05-20 20:26 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-05-20 20:36 ` ✓ i915.CI.BAT: " Patchwork
2025-05-21  0:10 ` ✗ i915.CI.Full: failure " Patchwork
2025-05-21  7:41 ` ✗ Xe.CI.Full: " Patchwork
2025-05-23  8:27   ` Anirban, Sk
2025-05-22 12:06 ` [PATCH] " Koppuravuri, Ravi Kishore
2025-05-22 15:06 ` Koppuravuri, Ravi Kishore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox