[PATCH 07/11] drm/xe/xe2hpg: Remove extra allocation of CCS pages for dgfx

Matt Roper matthew.d.roper at intel.com
Tue Apr 2 14:40:40 UTC 2024


On Tue, Apr 02, 2024 at 06:17:20PM +0530, Balasubramani Vivekanandan wrote:
> From: Akshata Jahagirdar <akshata.jahagirdar at intel.com>
> 
> In case of discrete platforms of Xe2_HPG, we don't need to handle
> copying flat ccs metadata during eviction and restore.  So, remove the
> extra allocation of ccs_pages.

This code change looks correct, but some more explanation in the commit
message might be good.  I.e., when evicting, the copy uses a mapping
with uncompressed PAT so the copy in SMEM is guaranteed to be
uncompressed.  And then when bringing the buffer back to vram later, it
will either stay uncompressed or get recompressed based on the vram
mapping of that copy, so there's no need for extra metadata storage in
SMEM.

If I remember correctly, in practice we always want to bring buffers
back into VRAM uncompressed as well, although I don't remember now what
the reasoning was there.


Matt

> 
> Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar at intel.com>
> Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_bo.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 9298546909b5..f710caf5cc79 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -2201,6 +2201,9 @@ bool xe_bo_needs_ccs_pages(struct xe_bo *bo)
>  {
>  	struct xe_device *xe = xe_bo_device(bo);
>  
> +	if (GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe))
> +		return false;
> +
>  	if (!xe_device_has_flat_ccs(xe) || bo->ttm.type != ttm_bo_type_device)
>  		return false;
>  
> -- 
> 2.25.1
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


More information about the Intel-xe mailing list