All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 i-g-t 1/2] lib/xe_gt: Add function to toggle efficient freq
@ 2026-11-13  2:11 Vinay Belgaumkar
  2026-11-13  2:11 ` [PATCH v2 i-g-t 2/2] tests/xe_gt_freq: Disable efficient freq using sysfs Vinay Belgaumkar
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Vinay Belgaumkar @ 2026-11-13  2:11 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: Vinay Belgaumkar, Sk Anirban

This writes to the use_rpe sysfs interface to toggle the use
of GT efficient frequency. The KMD patch that introduces this
sysfs is at: https://patchwork.freedesktop.org/series/178352/

v2: Address review comments (Anirban)

Cc: Sk Anirban <sk.anirban@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
---
 lib/xe/xe_gt.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/xe/xe_gt.h |  2 ++
 2 files changed, 61 insertions(+)

diff --git a/lib/xe/xe_gt.c b/lib/xe/xe_gt.c
index 1f0b77986..6f33df890 100644
--- a/lib/xe/xe_gt.c
+++ b/lib/xe/xe_gt.c
@@ -345,6 +345,65 @@ int xe_gt_set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq)
 	return ret;
 }
 
+/**
+ * xe_gt_set_use_rpe:
+ * @fd: pointer to xe drm fd
+ * @gt_id: GT id
+ * @val: Value to set use_rpe
+ *
+ * Set use_rpe. Function will assert if the sysfs node is
+ * not found.
+ *
+ * Return: success or failure
+ */
+int xe_gt_set_use_rpe(int fd, int gt_id, uint32_t val)
+{
+	int ret = -EAGAIN;
+	int gt_fd;
+
+	gt_fd = xe_sysfs_gt_open(fd, gt_id);
+	igt_assert_lte(0, gt_fd);
+
+	while (ret == -EAGAIN)
+		ret = igt_sysfs_printf(gt_fd, "freq0/use_rpe", "%u", val);
+
+	close(gt_fd);
+
+	return ret;
+}
+
+/**
+ * xe_gt_get_use_rpe:
+ * @fd: pointer to xe drm fd
+ * @gt_id: GT id
+ *
+ * Get use_rpe. Function will assert if the sysfs node is
+ * not found.
+ *
+ * Return: use_rpe value
+ */
+uint32_t xe_gt_get_use_rpe(int fd, int gt_id)
+{
+	int err = -EAGAIN;
+	int gt_fd;
+	uint32_t use_rpe;
+
+	igt_debug("Opening attr: %s\n", "freq0/rpe");
+	gt_fd = xe_sysfs_gt_open(fd, gt_id);
+	igt_assert_lte(0, gt_fd);
+
+	while (err == -EAGAIN)
+		err = igt_sysfs_scanf(gt_fd, "freq0/use_rpe", "%u", &use_rpe);
+
+	igt_assert_eq(err, 1);
+
+	igt_debug("gt%d: use_rpe %u\n", gt_id, use_rpe);
+
+	close(gt_fd);
+
+	return use_rpe;
+}
+
 /**
  * xe_gt_get_freq:
  * @fd: pointer to xe drm fd
diff --git a/lib/xe/xe_gt.h b/lib/xe/xe_gt.h
index 9ef15d7dd..7f824ca63 100644
--- a/lib/xe/xe_gt.h
+++ b/lib/xe/xe_gt.h
@@ -29,4 +29,6 @@ int xe_gt_count_engines_by_class(int fd, int gt, int class);
 
 int xe_gt_set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq);
 uint32_t xe_gt_get_freq(int fd, int gt_id, const char *freq_name);
+uint32_t xe_gt_get_use_rpe(int fd, int gt_id);
+int xe_gt_set_use_rpe(int fd, int gt_id, uint32_t val);
 #endif
-- 
2.53.0


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

end of thread, other threads:[~2026-12-03 22:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  2:11 [PATCH v2 i-g-t 1/2] lib/xe_gt: Add function to toggle efficient freq Vinay Belgaumkar
2026-11-13  2:11 ` [PATCH v2 i-g-t 2/2] tests/xe_gt_freq: Disable efficient freq using sysfs Vinay Belgaumkar
2026-12-03 18:02   ` Anirban, Sk
2026-11-13  3:38 ` ✓ Xe.CI.BAT: success for series starting with [v2,i-g-t,1/2] lib/xe_gt: Add function to toggle efficient freq Patchwork
2026-11-13  3:57 ` ✓ i915.CI.BAT: " Patchwork
2026-11-13 16:44 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-14  8:06 ` ✗ i915.CI.Full: failure " Patchwork
2026-11-17 14:19 ` [PATCH v2 i-g-t 1/2] " Kamil Konieczny
2026-11-19  0:15   ` Belgaumkar, Vinay
2026-12-03 17:38 ` Anirban, Sk
2026-12-03 22:37   ` Belgaumkar, Vinay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.