Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Laguna <lukasz.laguna@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t v2 1/2] lib/xe/xe_ioctl: add __xe_exec_sync() helper
Date: Tue, 12 Dec 2023 18:48:15 +0100	[thread overview]
Message-ID: <20231212174816.5292-2-lukasz.laguna@intel.com> (raw)
In-Reply-To: <20231212174816.5292-1-lukasz.laguna@intel.com>

Add non-asserting variant of xe_exec_sync().

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
 lib/xe/xe_ioctl.c | 12 +++++++++---
 lib/xe/xe_ioctl.h |  2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
index cdad3d7e2..b5cd3ae35 100644
--- a/lib/xe/xe_ioctl.c
+++ b/lib/xe/xe_ioctl.c
@@ -448,8 +448,8 @@ void xe_exec(int fd, struct drm_xe_exec *exec)
 	igt_assert_eq(__xe_exec(fd, exec), 0);
 }
 
-void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
-		  struct drm_xe_sync *sync, uint32_t num_syncs)
+int __xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
+		   struct drm_xe_sync *sync, uint32_t num_syncs)
 {
 	struct drm_xe_exec exec = {
 		.exec_queue_id = exec_queue,
@@ -459,7 +459,13 @@ void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
 		.num_batch_buffer = 1,
 	};
 
-	igt_assert_eq(__xe_exec(fd, &exec), 0);
+	return __xe_exec(fd, &exec);
+}
+
+void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
+		    struct drm_xe_sync *sync, uint32_t num_syncs)
+{
+	igt_assert_eq(__xe_exec_sync(fd, exec_queue, addr, sync, num_syncs), 0);
 }
 
 void xe_exec_wait(int fd, uint32_t exec_queue, uint64_t addr)
diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
index c8d46fb29..3679ce66b 100644
--- a/lib/xe/xe_ioctl.h
+++ b/lib/xe/xe_ioctl.h
@@ -88,6 +88,8 @@ void *xe_bo_map(int fd, uint32_t bo, size_t size);
 void *xe_bo_mmap_ext(int fd, uint32_t bo, size_t size, int prot);
 int __xe_exec(int fd, struct drm_xe_exec *exec);
 void xe_exec(int fd, struct drm_xe_exec *exec);
+int __xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
+		   struct drm_xe_sync *sync, uint32_t num_syncs);
 void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
 		  struct drm_xe_sync *sync, uint32_t num_syncs);
 void xe_exec_wait(int fd, uint32_t exec_queue, uint64_t addr);
-- 
2.40.0

  reply	other threads:[~2023-12-12 17:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 17:48 [PATCH i-g-t v2 0/2] Add create-contexts subtest Lukasz Laguna
2023-12-12 17:48 ` Lukasz Laguna [this message]
2023-12-13 12:00   ` [PATCH i-g-t v2 1/2] lib/xe/xe_ioctl: add __xe_exec_sync() helper Bernatowicz, Marcin
2023-12-12 17:48 ` [PATCH i-g-t v2 2/2] tests/intel/xe_create: create-contexts subtest Lukasz Laguna
2023-12-12 19:15 ` ✗ Fi.CI.BAT: failure for Add " Patchwork
2023-12-12 20:26 ` ✓ CI.xeBAT: 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=20231212174816.5292-2-lukasz.laguna@intel.com \
    --to=lukasz.laguna@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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