Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Manszewski <christoph.manszewski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
	"Dominik Grzegorzek" <dominik.grzegorzek@intel.com>,
	"Marcin Bernatowicz" <marcin.bernatowicz@linux.intel.com>,
	"Mika Kuoppala" <mika.kuoppala@linux.intel.com>,
	"Lukasz Laguna" <lukasz.laguna@intel.com>,
	"Michal Wajdeczko" <michal.wajdeczko@intel.com>,
	"Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
	"Christoph Manszewski" <christoph.manszewski@intel.com>
Subject: [PATCH i-g-t v2 1/2] lib/xe_eudebug: Export __xe_eudebug_enable_getset
Date: Thu, 20 Feb 2025 15:59:11 +0100	[thread overview]
Message-ID: <20250220145912.37735-2-christoph.manszewski@intel.com> (raw)
In-Reply-To: <20250220145912.37735-1-christoph.manszewski@intel.com>

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

Signed-off-by: Christoph Manszewski <christoph.manszewski@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


  reply	other threads:[~2025-02-20 14:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 14:59 [PATCH i-g-t v2 0/2] Ensure that SR-IOV and eudebug are exclusive for Xe Christoph Manszewski
2025-02-20 14:59 ` Christoph Manszewski [this message]
2025-02-24 13:20   ` [PATCH i-g-t v2 1/2] lib/xe_eudebug: Export __xe_eudebug_enable_getset Piatkowski, Dominik Karol
2025-02-20 14:59 ` [PATCH i-g-t v2 2/2] tests/intel/xe_eudebug: Add subtests for eudebug/SR-IOV exclusion Christoph Manszewski
2025-02-24 13:31   ` Piatkowski, Dominik Karol
2025-02-26 10:05     ` Manszewski, Christoph
2025-02-27 16:39   ` Grzegorzek, Dominik
2025-02-28 15:23     ` Manszewski, Christoph
2025-02-20 19:12 ` ✓ Xe.CI.BAT: success for Ensure that SR-IOV and eudebug are exclusive for Xe (rev2) Patchwork
2025-02-20 19:23 ` ✗ i915.CI.BAT: failure " Patchwork
2025-02-21 13:15 ` ✓ Xe.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250220145912.37735-2-christoph.manszewski@intel.com \
    --to=christoph.manszewski@intel.com \
    --cc=dominik.grzegorzek@intel.com \
    --cc=dominik.karol.piatkowski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=lukasz.laguna@intel.com \
    --cc=marcin.bernatowicz@linux.intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=mika.kuoppala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox