aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejas Upadhyay <[email protected]>2023-08-10 11:33:24 +0530
committerRodrigo Vivi <[email protected]>2023-12-21 11:41:15 -0500
commit9e4e9761e64ea1086629852d30c08307538154ec (patch)
tree5ff01fb75162a1912a3e07254aaebff94cdb4a41
parentb27970f3e11c616c7a5121537502f6e21a460881 (diff)
drm/xe: Record each drm client with its VM
Enable accounting of indirect client memory usage. Reviewed-by: Himal Prasad Ghimiray <[email protected]> Signed-off-by: Tejas Upadhyay <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_vm.c1
-rw-r--r--drivers/gpu/drm/xe/xe_vm_types.h2
2 files changed, 3 insertions, 0 deletions
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 */