All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sobin Thomas <sobin.thomas@intel.com>
To: igt-dev@lists.freedesktop.org, nishit.sharma@intel.com,
	priyanka.dandamudi@intel.com
Cc: matthew.brost@intel.com, kamil.konieczny@intel.com
Subject: [PATCH i-g-t v9 1/6] lib/xe: Add __xe_vm_bind_array() returning errno
Date: Wed,  2 Dec 2026 04:18:04 +0000	[thread overview]
Message-ID: <20261202041809.713401-2-sobin.thomas@intel.com> (raw)
In-Reply-To: <20261202041809.713401-1-sobin.thomas@intel.com>

xe_vm_bind_array() asserts that the VM_BIND ioctl succeeds. Add
__xe_vm_bind_array() to return 0 or -errno, and keep xe_vm_bind_array()
as an asserting wrapper for existing callers.

Signed-off-by: Sobin Thomas <sobin.thomas@intel.com>
---
 lib/xe/xe_ioctl.c | 22 +++++++++++++++++-----
 lib/xe/xe_ioctl.h |  4 ++++
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
index c8ed99182..6d98b01c7 100644
--- a/lib/xe/xe_ioctl.c
+++ b/lib/xe/xe_ioctl.c
@@ -178,10 +178,10 @@ void xe_vm_unbind_all_async(int fd, uint32_t vm, uint32_t exec_queue,
 			    sync, num_syncs, 0, 0);
 }
 
-void xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue,
-		      struct drm_xe_vm_bind_op *bind_ops,
-		      uint32_t num_bind, struct drm_xe_sync *sync,
-		      uint32_t num_syncs)
+int __xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue,
+		       struct drm_xe_vm_bind_op *bind_ops,
+		       uint32_t num_bind, struct drm_xe_sync *sync,
+		       uint32_t num_syncs)
 {
 	struct drm_xe_vm_bind bind = {
 		.vm_id = vm,
@@ -193,7 +193,19 @@ void xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue,
 	};
 
 	igt_assert(num_bind > 1);
-	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_VM_BIND, &bind), 0);
+	if (igt_ioctl(fd, DRM_IOCTL_XE_VM_BIND, &bind))
+		return -errno;
+
+	return 0;
+}
+
+void xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue,
+		      struct drm_xe_vm_bind_op *bind_ops,
+		      uint32_t num_bind, struct drm_xe_sync *sync,
+		      uint32_t num_syncs)
+{
+	igt_assert_eq(__xe_vm_bind_array(fd, vm, exec_queue, bind_ops, num_bind, sync, num_syncs),
+		      0);
 }
 
 int  ___xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
index bf40fb6bd..517733f24 100644
--- a/lib/xe/xe_ioctl.h
+++ b/lib/xe/xe_ioctl.h
@@ -126,4 +126,8 @@ int __xe_vm_bind_lr_sync(int fd, uint32_t vm, uint32_t bo, uint64_t offset,
 			 uint64_t addr, uint64_t size, uint32_t flags);
 void xe_vm_unbind_lr_sync(int fd, uint32_t vm, uint64_t offset,
 			  uint64_t addr, uint64_t size);
+int __xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue,
+		       struct drm_xe_vm_bind_op *bind_ops,
+		       uint32_t num_bind, struct drm_xe_sync *sync,
+		       uint32_t num_syncs);
 #endif /* XE_IOCTL_H */
-- 
2.55.0


  reply	other threads:[~2026-12-02  4:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  4:18 [PATCH i-g-t v9 0/6] Add BO Allocation and VM Bind stress infra Sobin Thomas
2026-12-02  4:18 ` Sobin Thomas [this message]
2026-12-02  4:18 ` [PATCH i-g-t v9 4/6] tests/intel: Add array-of-binds random-size allocation tests Sobin Thomas
2026-12-02  4:18 ` [PATCH i-g-t v9 5/6] tests/intel: Add threaded random-size allocation stress tests Sobin Thomas
2026-12-02  4:18 ` [PATCH i-g-t v9 6/6] tests/intel: Add oversubscribe concurrent bind stress subtest Sobin Thomas

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=20261202041809.713401-2-sobin.thomas@intel.com \
    --to=sobin.thomas@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=nishit.sharma@intel.com \
    --cc=priyanka.dandamudi@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 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.