Skip to content

Commit

Permalink
drm/xe: Take a ref to xe file when user creates a VM
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Umesh Nerlige Ramappa authored and Lucas De Marchi committed Jul 19, 2024
1 parent ce8c161 commit a2387e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/gpu/drm/xe/xe_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,10 @@ static void vm_destroy_work_func(struct work_struct *w)
XE_WARN_ON(vm->pt_root[id]);

trace_xe_vm_free(vm);

if (vm->xef)
xe_file_put(vm->xef);

kfree(vm);
}

Expand Down Expand Up @@ -1802,7 +1806,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
}

args->vm_id = id;
vm->xef = xef;
vm->xef = xe_file_get(xef);

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

0 comments on commit a2387e6

Please sign in to comment.