]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/xe: Record each drm client with its VM
authorTejas Upadhyay <tejas.upadhyay@intel.com>
Thu, 10 Aug 2023 06:03:24 +0000 (11:33 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:41:15 +0000 (11:41 -0500)
Enable accounting of indirect client memory usage.

Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_vm.c
drivers/gpu/drm/xe/xe_vm_types.h

index 53add99d4186ff7b5b0eff0a0333f9fa10a33241..92d682ee60306328b561e557cfc88b64d057688e 100644 (file)
@@ -2058,6 +2058,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
        }
 
        args->vm_id = id;
+       vm->xef = xef;
 
 #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEM)
        /* Warning: Security issue - never enable by default */
index dfbc53e56a8696b55ce900f9682e8491d7af1767..b0f183d00416bdc362dbf1dcfe4a60d871ecfd95 100644 (file)
@@ -329,6 +329,8 @@ struct xe_vm {
 
        /** @batch_invalidate_tlb: Always invalidate TLB before batch start */
        bool batch_invalidate_tlb;
+       /** @xef: XE file handle for tracking this VM's drm client */
+       struct xe_file *xef;
 };
 
 /** struct xe_vma_op_map - VMA map operation */