@@ -232,6 +232,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 = {
@@ -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, uint32_t *handle);
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 <jonathan.cavitt@intel.com> --- lib/xe/xe_ioctl.c | 5 +++++ lib/xe/xe_ioctl.h | 1 + 2 files changed, 6 insertions(+)