Skip to content

Commit 6309f9b

Browse files
unerligerodrigovivi
authored andcommitted
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: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240718210548.3580382-4-umesh.nerlige.ramappa@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> (cherry picked from commit a2387e6) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent d28bb01 commit 6309f9b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,10 @@ static void vm_destroy_work_func(struct work_struct *w)
16011601
XE_WARN_ON(vm->pt_root[id]);
16021602

16031603
trace_xe_vm_free(vm);
1604+
1605+
if (vm->xef)
1606+
xe_file_put(vm->xef);
1607+
16041608
kfree(vm);
16051609
}
16061610

@@ -1916,7 +1920,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
19161920
}
19171921

19181922
args->vm_id = id;
1919-
vm->xef = xef;
1923+
vm->xef = xe_file_get(xef);
19201924

19211925
/* Record BO memory for VM pagetable created against client */
19221926
for_each_tile(tile, xe, id)

0 commit comments

Comments
 (0)