From 9e4e9761e64ea1086629852d30c08307538154ec Mon Sep 17 00:00:00 2001 From: Tejas Upadhyay Date: Thu, 10 Aug 2023 11:33:24 +0530 Subject: [PATCH] drm/xe: Record each drm client with its VM Enable accounting of indirect client memory usage. Reviewed-by: Himal Prasad Ghimiray Signed-off-by: Tejas Upadhyay Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_vm.c | 1 + drivers/gpu/drm/xe/xe_vm_types.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 53add99d4186..92d682ee6030 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -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 */ diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h index dfbc53e56a86..b0f183d00416 100644 --- a/drivers/gpu/drm/xe/xe_vm_types.h +++ b/drivers/gpu/drm/xe/xe_vm_types.h @@ -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 */ -- 2.50.1