Commit 6309f9b1 authored by Umesh Nerlige Ramappa's avatar Umesh Nerlige Ramappa Committed by Rodrigo Vivi

drm/xe: Take a ref to xe file when user creates a VM

Take a reference to xef when user creates the VM and put the reference
when user destroys the VM.
Signed-off-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240718210548.3580382-4-umesh.nerlige.ramappa@intel.comSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
(cherry picked from commit a2387e69)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent d28bb012
...@@ -1601,6 +1601,10 @@ static void vm_destroy_work_func(struct work_struct *w) ...@@ -1601,6 +1601,10 @@ static void vm_destroy_work_func(struct work_struct *w)
XE_WARN_ON(vm->pt_root[id]); XE_WARN_ON(vm->pt_root[id]);
trace_xe_vm_free(vm); trace_xe_vm_free(vm);
if (vm->xef)
xe_file_put(vm->xef);
kfree(vm); kfree(vm);
} }
...@@ -1916,7 +1920,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data, ...@@ -1916,7 +1920,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
} }
args->vm_id = id; args->vm_id = id;
vm->xef = xef; vm->xef = xe_file_get(xef);
/* Record BO memory for VM pagetable created against client */ /* Record BO memory for VM pagetable created against client */
for_each_tile(tile, xe, id) for_each_tile(tile, xe, id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment