From: Soham Purkait <soham.purkait@intel.com>
To: igt-dev@lists.freedesktop.org, riana.tauro@intel.com,
badal.nilawar@intel.com, kamil.konieczny@intel.com
Cc: anshuman.gupta@intel.com, soham.purkait@intel.com,
umesh.nerlige.ramappa@intel.com
Subject: [PATCH i-g-t v4 2/3] lib/xe/xe_spin: Export xe_spin_sync_wait
Date: Tue, 6 Jan 2026 22:18:00 +0530 [thread overview]
Message-ID: <20260106164801.46353-3-soham.purkait@intel.com> (raw)
In-Reply-To: <20260106164801.46353-1-soham.purkait@intel.com>
Make function xe_spin_sync_wait() public
Which waits for the spin batch associated with the
given igt_spin object to complete by waiting
on its syncobj after spin end is executed.
v1:
- Add simple commit message. (Kamil)
v2:
- Add fd description for xe_spin_sync_wait. (Kamil)
- Add improved documentation for xe_spin_sync_wait. (Kamil)
Signed-off-by: Soham Purkait <soham.purkait@intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/xe/xe_spin.c | 14 +++++++++++++-
lib/xe/xe_spin.h | 1 +
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
index ad55293f5..4dc110c22 100644
--- a/lib/xe/xe_spin.c
+++ b/lib/xe/xe_spin.c
@@ -351,7 +351,19 @@ xe_spin_create(int fd, const struct igt_spin_factory *opt)
return spin;
}
-static void xe_spin_sync_wait(int fd, struct igt_spin *spin)
+/**
+ * xe_spin_sync_wait - Wait for a GPU spin workload to complete
+ * @fd: File descriptor for the DRM device
+ * @spin: Pointer to an igt_spin structure representing the spin workload
+ *
+ * This function blocks until the GPU spin operation associated with the
+ * given `igt_spin` object has finished, ensuring that the function does
+ * not return until the workload completes.
+ * If the wait fails, `igt_assert()` will trigger an assertion failure.
+ *
+ * This function does not return a value. It aborts on failure.
+ */
+void xe_spin_sync_wait(int fd, struct igt_spin *spin)
{
igt_assert(syncobj_wait(fd, &spin->syncobj, 1, INT64_MAX, 0, NULL));
}
diff --git a/lib/xe/xe_spin.h b/lib/xe/xe_spin.h
index 5dfe05cb5..31154997b 100644
--- a/lib/xe/xe_spin.h
+++ b/lib/xe/xe_spin.h
@@ -81,6 +81,7 @@ void xe_spin_reset(int fd, igt_spin_t *spin);
bool xe_spin_started(struct xe_spin *spin);
void xe_spin_wait_started(struct xe_spin *spin);
void xe_spin_end(struct xe_spin *spin);
+void xe_spin_sync_wait(int fd, struct igt_spin *spin);
void xe_spin_preempt_wait(struct xe_spin *spin);
void xe_spin_preempt_nowait(struct xe_spin *spin);
--
2.34.1
next prev parent reply other threads:[~2026-01-06 16:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 16:47 [PATCH i-g-t v4 0/3] Improve engine activity accuracy test with spinner reuse Soham Purkait
2026-01-06 16:47 ` [PATCH i-g-t v4 1/3] lib/xe/xe_spin: Introduce xe_spin_reset Soham Purkait
2026-01-06 16:48 ` Soham Purkait [this message]
2026-01-06 16:48 ` [PATCH i-g-t v4 3/3] tests/intel/xe_pmu: Refine engine activity accuracy test Soham Purkait
2026-01-07 8:45 ` Riana Tauro
2026-01-06 17:44 ` ✓ Xe.CI.BAT: success for Improve engine activity accuracy test with spinner reuse (rev6) Patchwork
2026-01-06 18:02 ` ✓ i915.CI.BAT: " Patchwork
2026-01-06 18:59 ` ✓ Xe.CI.Full: " Patchwork
2026-01-06 22:15 ` ✓ i915.CI.Full: " 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=20260106164801.46353-3-soham.purkait@intel.com \
--to=soham.purkait@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@intel.com \
--cc=riana.tauro@intel.com \
--cc=umesh.nerlige.ramappa@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