From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47B6F1076387 for ; Wed, 1 Apr 2026 17:09:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D17C910E292; Wed, 1 Apr 2026 17:09:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="cB7t1lNL"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id BCF6B10E292 for ; Wed, 1 Apr 2026 17:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775063363; x=1806599363; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i6cTCvMYLr3OaBdouRXtr3wmVFLl3UMXRDx2XnikxIw=; b=cB7t1lNL1vh06x2vR78YRKtX0XinZmaWYtFmSSxzAgU+3bmSRIEwPzv+ 5gUsxchdc6B3QNatPcHdqcpoERe2paOJYDru6Vy4jQscSZBiDPICpz1+9 S0VvWcUZ9AV8BTL6TshhrIZHqkgJMVUEIckJvvI0uS9eWqYtXMNNNbO4N jCYXCr+CIfKIeaNXeJLd0DGgIXvZu/zBbRHbwdhfjFjkBKmMnFccE0AFb kfL8sl2M8I97KhDhRKpzswNRw8gvueRUivR31U6hYalJRO4rtXbbEiPXa rjjmpBns1YNI2xAnX+2u/2oolNBgTT11ZanfekCk1BtTOAms/C6KPIO3R g==; X-CSE-ConnectionGUID: OxkVKYY0SiKM6LDhU9wN6g== X-CSE-MsgGUID: U8mplIdaQgOd0uua8pmyqQ== X-IronPort-AV: E=McAfee;i="6800,10657,11745"; a="86724320" X-IronPort-AV: E=Sophos;i="6.23,153,1770624000"; d="scan'208";a="86724320" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2026 10:09:17 -0700 X-CSE-ConnectionGUID: XTc7dSIlTp+JxyeR0rYqJQ== X-CSE-MsgGUID: mU9BvTk9RAKXG+YxYhRBLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,153,1770624000"; d="scan'208";a="226593734" Received: from dut4449lnl.fm.intel.com ([10.105.8.75]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2026 10:09:17 -0700 From: Jonathan Cavitt To: igt-dev@lists.freedesktop.org Cc: saurabhg.gupta@intel.com, alex.zuo@intel.com, jonathan.cavitt@intel.com, joonas.lahtinen@linux.intel.com, matthew.brost@intel.com, jianxun.zhang@intel.com, stuart.summers@intel.com, shuicheng.lin@intel.com, nishit.sharma@intel.com, matthew.auld@intel.com, kamil.konieczny@linux.intel.com Subject: [PATCH v9 2/4] lib/xe/xe_ioctl: Add xe_vm_get_property helper function Date: Wed, 1 Apr 2026 17:09:17 +0000 Message-ID: <20260401170914.16908-8-jonathan.cavitt@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260401170914.16908-6-jonathan.cavitt@intel.com> References: <20260401170914.16908-6-jonathan.cavitt@intel.com> 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Add a helper function, xe_vm_get_property, that calls the drm_xe_vm_get_property ioctl. Since the ioctl behaves similarly to an xe_query in that it needs to be called once to get the size of the return data and again to save the data, the helper function takes the ioctl structure as a parameter. Signed-off-by: Jonathan Cavitt Reviewed-by: Nishit Sharma --- lib/xe/xe_ioctl.c | 5 +++++ lib/xe/xe_ioctl.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c index ea3f2fcaab..7a8444095f 100644 --- a/lib/xe/xe_ioctl.c +++ b/lib/xe/xe_ioctl.c @@ -332,6 +332,11 @@ void xe_vm_unbind_sync(int fd, uint32_t vm, uint64_t offset, __xe_vm_bind_sync(fd, vm, 0, offset, addr, size, DRM_XE_VM_BIND_OP_UNMAP); } +void xe_vm_get_property(int fd, uint32_t vm, struct drm_xe_vm_get_property *query) +{ + igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_VM_GET_PROPERTY, query), 0); +} + void xe_vm_destroy(int fd, uint32_t vm) { struct drm_xe_vm_destroy destroy = { diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h index b62d259fda..4ac526a8ec 100644 --- a/lib/xe/xe_ioctl.h +++ b/lib/xe/xe_ioctl.h @@ -65,6 +65,7 @@ void xe_vm_bind_array(int fd, uint32_t vm, uint32_t exec_queue, void xe_vm_unbind_all_async(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo, struct drm_xe_sync *sync, uint32_t num_syncs); +void xe_vm_get_property(int fd, uint32_t vm, struct drm_xe_vm_get_property *query); void xe_vm_destroy(int fd, uint32_t vm); uint32_t __xe_bo_create(int fd, uint32_t vm, uint64_t size, uint32_t placement, uint32_t flags, void *ext, uint32_t *handle); -- 2.43.0