From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B06A8606A336 for ; Wed, 2 Dec 2026 04:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=MyECcnUB Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B9BC10E02B; Wed, 2 Dec 2026 04:20:13 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 13DDB10E241 for ; Wed, 2 Dec 2026 04:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796185091; x=1827721091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e92YvNq88dwGBZkZhVBCLaB0e/JxR2tvbXVuTDIF768=; b=MyECcnUBWUTpznvhbun25fSniddTa3JKrDnoWc3eDK/NABJ7AdoN6nUL RDa9kTurdNlqp9AMef4apnV3KTKqpXPVGdgJaWIcatJPKWGpZIcDBgGhE 2jq9ngcxMLmiasF8pttY05MWPlVvok7Ec9i9YhndgPraxPXSHctMqyhQs 7bqwGMDnTQJYMJ/W37kps3zq0PscqGwvicgSbfUPu1jdIzS9z9a58R83G ghu66NPb5ZQEbU2A5lshVqUnmDILLnTIrLw5fcPnGxzkzeZ9cXQ80N6pQ 8GnWESfe1HwJ9u7NUNksc+osvj+I2qOzhIFikSarnHkUmcvqGp/KCwgVt Q==; X-CSE-ConnectionGUID: RfXpcHdcS9m3oO5edZZxZQ== X-CSE-MsgGUID: WENl7rBBRSWRdaOxF58nLQ== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="4996794" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="4996794" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 20:18:09 -0800 X-CSE-ConnectionGUID: PLbzaDi7QPC32OaBPXeocQ== X-CSE-MsgGUID: s7qS/UR2RhyPlXVXnpgIoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13288848" Received: from dut6245dg2frd.fm.intel.com ([10.36.24.131]) by orviesa003.jf.intel.com with ESMTP; 01 Dec 2026 20:18:09 -0800 From: Sobin Thomas 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 Message-ID: <20261202041809.713401-2-sobin.thomas@intel.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261202041809.713401-1-sobin.thomas@intel.com> References: <20261202041809.713401-1-sobin.thomas@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "igt-dev" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 --- 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