intel: Sync xe_drm.h final part

Sync xe_drm.h with commit a8ff56e160bb ("drm/xe/uapi: Remove reset uevent for now").

This is the last xe_drm.h uAPI break.

The only relevant change for ANV and Iris is that now VM bind uAPI
is asynchronous only so I had to bring back the syncobj creation, wait
and destruction.

Is still in the Xe port TODO list to make VM binds truly asynchronous.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26699>
This commit is contained in:
José Roberto de Souza
2023-12-14 09:41:22 -08:00
committed by Marge Bot
parent 2ac78b5096
commit dea6c82437
3 changed files with 676 additions and 398 deletions
+28 -2
View File
@@ -116,13 +116,24 @@ static inline int
xe_vm_bind_op(struct anv_device *device,
struct anv_sparse_submission *submit)
{
int ret;
struct drm_xe_sync xe_sync = {
.type = DRM_XE_SYNC_TYPE_SYNCOBJ,
.flags = DRM_XE_SYNC_FLAG_SIGNAL,
};
struct drm_xe_vm_bind args = {
.vm_id = device->vm_id,
.num_binds = submit->binds_len,
.bind = {},
.num_syncs = 1,
.syncs = (uintptr_t)&xe_sync,
};
struct drm_syncobj_create syncobj_create = {};
struct drm_syncobj_destroy syncobj_destroy = {};
struct drm_syncobj_wait syncobj_wait = {
.timeout_nsec = INT64_MAX,
.count_handles = 1,
};
int ret;
STACK_ARRAY(struct drm_xe_vm_bind_op, xe_binds_stackarray,
submit->binds_len);
@@ -173,7 +184,22 @@ xe_vm_bind_op(struct anv_device *device,
xe_bind->userptr = (uintptr_t)bo->map;
}
ret = intel_ioctl(device->fd, DRM_IOCTL_SYNCOBJ_CREATE, &syncobj_create);
if (ret)
goto out_stackarray;
xe_sync.handle = syncobj_create.handle;
ret = intel_ioctl(device->fd, DRM_IOCTL_XE_VM_BIND, &args);
if (ret)
goto out_destroy_syncobj;
syncobj_wait.handles = (uintptr_t)&xe_sync.handle;
ret = intel_ioctl(device->fd, DRM_IOCTL_SYNCOBJ_WAIT, &syncobj_wait);
out_destroy_syncobj:
syncobj_destroy.handle = xe_sync.handle;
intel_ioctl(device->fd, DRM_IOCTL_SYNCOBJ_DESTROY, &syncobj_destroy);
out_stackarray:
STACK_ARRAY_FINISH(xe_binds_stackarray);
return ret;