[PATCH i-g-t v2 1/2] lib/xe_eudebug: Export __xe_eudebug_enable_getset

Christoph Manszewski christoph.manszewski at intel.com
Thu Feb 20 14:59:11 UTC 2025


Export __xe_eudebug_enable_getset to make it possible to catch error
code in tests.

Signed-off-by: Christoph Manszewski <christoph.manszewski at intel.com>
---
 lib/xe/xe_eudebug.c | 15 +++++++++++++--
 lib/xe/xe_eudebug.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/xe/xe_eudebug.c b/lib/xe/xe_eudebug.c
index 1205d945b..04f0e86e9 100644
--- a/lib/xe/xe_eudebug.c
+++ b/lib/xe/xe_eudebug.c
@@ -1710,7 +1710,18 @@ static void metadata_event(struct xe_eudebug_client *c, uint32_t flags,
 	xe_eudebug_event_log_write(c->log, (void *)&em);
 }
 
-static int enable_getset(int fd, bool *old, bool *new)
+/**
+ * __xe_eudebug_enable_getset
+ * @fd: xe client
+ * @old: pointer to store current toggle value
+ * @new: pointer to new toggle value
+ *
+ * Stores current eudebug feature state in @old if not NULL. Sets new eudebug
+ * feature state to @new if not NULL. Asserts if both @old and @new are NULL.
+ *
+ * Returns: 0 on success, -1 on failure.
+ */
+int __xe_eudebug_enable_getset(int fd, bool *old, bool *new)
 {
 	static const char * const fname = "enable_eudebug";
 	int ret = 0;
@@ -1767,7 +1778,7 @@ out:
 bool xe_eudebug_enable(int fd, bool enable)
 {
 	bool old = false;
-	int ret = enable_getset(fd, &old, &enable);
+	int ret = __xe_eudebug_enable_getset(fd, &old, &enable);
 
 	if (ret) {
 		igt_skip_on(enable);
diff --git a/lib/xe/xe_eudebug.h b/lib/xe/xe_eudebug.h
index 823c7f6ea..3adde5f6c 100644
--- a/lib/xe/xe_eudebug.h
+++ b/lib/xe/xe_eudebug.h
@@ -171,6 +171,7 @@ void xe_eudebug_client_wait_stage(struct xe_eudebug_client *c, uint64_t stage);
 uint64_t xe_eudebug_client_get_seqno(struct xe_eudebug_client *c);
 void xe_eudebug_client_set_data(struct xe_eudebug_client *c, void *ptr);
 
+int __xe_eudebug_enable_getset(int fd, bool *old, bool *new);
 bool xe_eudebug_enable(int fd, bool enable);
 
 int xe_eudebug_client_open_driver(struct xe_eudebug_client *c);
-- 
2.34.1



More information about the igt-dev mailing list