drm/xe/uapi: Use LR abbrev for long-running vms
Currently we're using "compute mode" for long running VMs using preempt-fences for memory management, and "fault mode" for long running VMs using page faults. Change this to use the terminology "long-running" abbreviated as LR for long-running VMs. These VMs can then either be in preempt-fence mode or fault mode. The user can force fault mode at creation time, but otherwise the driver can choose to use fault- or preempt-fence mode for long-running vms depending on the device capabilities. Initially unless fault-mode is specified, the driver uses preempt-fence mode. v2: - Fix commit message wording and the documentation around CREATE_FLAG_LR_MODE and CREATE_FLAG_FAULT_MODE Cc: Matthew Brost <matthew.brost@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Francois Dugast <francois.dugast@intel.com> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
926ad2c380
commit
9329f06672
@ -1921,7 +1921,7 @@ static int xe_vm_unbind(struct xe_vm *vm, struct xe_vma *vma,
|
||||
}
|
||||
|
||||
#define ALL_DRM_XE_VM_CREATE_FLAGS (DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE | \
|
||||
DRM_XE_VM_CREATE_FLAG_COMPUTE_MODE | \
|
||||
DRM_XE_VM_CREATE_FLAG_LR_MODE | \
|
||||
DRM_XE_VM_CREATE_FLAG_ASYNC_DEFAULT | \
|
||||
DRM_XE_VM_CREATE_FLAG_FAULT_MODE)
|
||||
|
||||
@ -1957,7 +1957,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
|
||||
args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
|
||||
return -EINVAL;
|
||||
|
||||
if (XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_COMPUTE_MODE &&
|
||||
if (XE_IOCTL_DBG(xe, !(args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE) &&
|
||||
args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
|
||||
return -EINVAL;
|
||||
|
||||
@ -1974,12 +1974,12 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
|
||||
|
||||
if (args->flags & DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE)
|
||||
flags |= XE_VM_FLAG_SCRATCH_PAGE;
|
||||
if (args->flags & DRM_XE_VM_CREATE_FLAG_COMPUTE_MODE)
|
||||
if (args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE)
|
||||
flags |= XE_VM_FLAG_LR_MODE;
|
||||
if (args->flags & DRM_XE_VM_CREATE_FLAG_ASYNC_DEFAULT)
|
||||
flags |= XE_VM_FLAG_ASYNC_DEFAULT;
|
||||
if (args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE)
|
||||
flags |= XE_VM_FLAG_LR_MODE | XE_VM_FLAG_FAULT_MODE;
|
||||
flags |= XE_VM_FLAG_FAULT_MODE;
|
||||
|
||||
vm = xe_vm_create(xe, flags);
|
||||
if (IS_ERR(vm))
|
||||
|
@ -648,8 +648,29 @@ struct drm_xe_vm_create {
|
||||
__u64 extensions;
|
||||
|
||||
#define DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE (1 << 0)
|
||||
#define DRM_XE_VM_CREATE_FLAG_COMPUTE_MODE (1 << 1)
|
||||
/*
|
||||
* An LR, or Long Running VM accepts exec submissions
|
||||
* to its exec_queues that don't have an upper time limit on
|
||||
* the job execution time. But exec submissions to these
|
||||
* don't allow any of the flags DRM_XE_SYNC_FLAG_SYNCOBJ,
|
||||
* DRM_XE_SYNC_FLAG_TIMELINE_SYNCOBJ, DRM_XE_SYNC_FLAG_DMA_BUF,
|
||||
* used as out-syncobjs, that is, together with DRM_XE_SYNC_FLAG_SIGNAL.
|
||||
* LR VMs can be created in recoverable page-fault mode using
|
||||
* DRM_XE_VM_CREATE_FLAG_FAULT_MODE, if the device supports it.
|
||||
* If that flag is omitted, the UMD can not rely on the slightly
|
||||
* different per-VM overcommit semantics that are enabled by
|
||||
* DRM_XE_VM_CREATE_FLAG_FAULT_MODE (see below), but KMD may
|
||||
* still enable recoverable pagefaults if supported by the device.
|
||||
*/
|
||||
#define DRM_XE_VM_CREATE_FLAG_LR_MODE (1 << 1)
|
||||
#define DRM_XE_VM_CREATE_FLAG_ASYNC_DEFAULT (1 << 2)
|
||||
/*
|
||||
* DRM_XE_VM_CREATE_FLAG_FAULT_MODE requires also
|
||||
* DRM_XE_VM_CREATE_FLAG_LR_MODE. It allows memory to be allocated
|
||||
* on demand when accessed, and also allows per-VM overcommit of memory.
|
||||
* The xe driver internally uses recoverable pagefaults to implement
|
||||
* this.
|
||||
*/
|
||||
#define DRM_XE_VM_CREATE_FLAG_FAULT_MODE (1 << 3)
|
||||
/** @flags: Flags */
|
||||
__u32 flags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user