Skip to content

Commit

Permalink
drm/xe: Use internal VM flags in xe_vm_create
Browse files Browse the repository at this point in the history
xe_vm_create used the IOCTL create flags in a few places rather than the
internal VM flags and this just happened to work as these values
matched. This is risky (and incorrect) as the internal flag values are
free to change. Fix this and use the internal VM flag values.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
  • Loading branch information
Matthew Brost authored and Rodrigo Vivi committed Dec 21, 2023
1 parent 55d8ac9 commit 54c9fb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/xe/xe_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,13 +1253,13 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
vm->batch_invalidate_tlb = true;
}

if (flags & DRM_XE_VM_CREATE_COMPUTE_MODE) {
if (flags & XE_VM_FLAG_COMPUTE_MODE) {
INIT_WORK(&vm->preempt.rebind_work, preempt_rebind_work_func);
vm->flags |= XE_VM_FLAG_COMPUTE_MODE;
vm->batch_invalidate_tlb = false;
}

if (flags & DRM_XE_VM_CREATE_ASYNC_BIND_OPS) {
if (flags & XE_VM_FLAG_ASYNC_BIND_OPS) {
vm->async_ops.fence.context = dma_fence_context_alloc(1);
vm->flags |= XE_VM_FLAG_ASYNC_BIND_OPS;
}
Expand Down

0 comments on commit 54c9fb7

Please sign in to comment.