[Intel-xe] [PATCH 6/7] drm/xe: Account ring buffer and context state storage

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Wed Sep 6 11:19:04 UTC 2023


On 31-08-2023 14:35, Tejas Upadhyay wrote:
> Account ring buffers and logical context space against the owning client
> memory usage stats.
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_lrc.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index 2b4219c38359..7dd745e23575 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -12,6 +12,7 @@
>   #include "regs/xe_regs.h"
>   #include "xe_bo.h"
>   #include "xe_device.h"
> +#include "xe_drm_client.h"
>   #include "xe_exec_queue_types.h"
>   #include "xe_gt.h"
>   #include "xe_hw_fence.h"
> @@ -739,9 +740,13 @@ int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
>   		kfree(init_data);
>   	}
>   
> -	if (vm)
> +	if (vm) {
>   		xe_lrc_set_ppgtt(lrc, vm);
>   
> +		if (vm->xef)
> +			xe_drm_client_add_bo(vm->xef->client, lrc->bo);
> +	}
LGTM.

Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> +
>   	xe_lrc_write_ctx_reg(lrc, CTX_RING_START, __xe_lrc_ring_ggtt_addr(lrc));
>   	xe_lrc_write_ctx_reg(lrc, CTX_RING_HEAD, 0);
>   	xe_lrc_write_ctx_reg(lrc, CTX_RING_TAIL, lrc->ring.tail);


More information about the Intel-xe mailing list