[Intel-xe] [PATCH V2 4/7] drm/xe: Record each drm client with its VM

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Wed Sep 13 08:58:13 UTC 2023


On 12-09-2023 17:22, Tejas Upadhyay wrote:
> Enable accounting of indirect client memory usage.
>
> Signed-off-by: Tejas Upadhyay<tejas.upadhyay at intel.com>
> ---
>   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 a6a0f17fec1d..92d8c78c9284 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -2051,6 +2051,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 52e5eaed91c3..af2ba4acf1f9 100644
> --- a/drivers/gpu/drm/xe/xe_vm_types.h
> +++ b/drivers/gpu/drm/xe/xe_vm_types.h
> @@ -336,6 +336,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;

LGTM. Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>

>   };
>   
>   /** struct xe_vma_op_map - VMA map operation */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20230913/f9060a27/attachment-0001.htm>


More information about the Intel-xe mailing list