[PATCH] drm/amdgpu: Fix incorrect mask used in gfx12
Felix Kuehling
felix.kuehling at amd.com
Fri Jul 25 18:29:51 UTC 2025
On 2025-07-25 12:53, Harish Kasiviswanathan wrote:
> NV10 mask used for gfx12. Fix it.
>
> Fixes: b8c76c59987a ("drm/amdgpu: rework how PTE flags are generated
> v3")
>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> index fb3fb31724a8..6260243012c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> @@ -517,7 +517,7 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
> if (bo && bo->flags & (AMDGPU_GEM_CREATE_COHERENT |
> AMDGPU_GEM_CREATE_EXT_COHERENT |
> AMDGPU_GEM_CREATE_UNCACHED))
> - *flags = AMDGPU_PTE_MTYPE_NV10(*flags, MTYPE_UC);
> + *flags = AMDGPU_PTE_MTYPE_GFX12(*flags, MTYPE_UC);
Thanks for spotting this. But I'm not sure if this is sufficient. The original code here looked like this:
if (bo && bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
*flags |= AMDGPU_PTE_DCC;
if (bo && bo->flags & AMDGPU_GEM_CREATE_UNCACHED)
*flags = AMDGPU_PTE_MTYPE_GFX12(*flags, MTYPE_UC);
The updated code still ignores AMDGPU_GEM_CREATE_GFX12_DCC. Given the symptoms (grey screen after suspend), the DCC flag seems relevant.
Christian's patch also changed the mtype for COHERENT and EXT_COHERENT memory allocations. Are we sure those should use MTYPE_UC on GFX12. I believe there was a workaround on GFX12 that required MTYPE_NC for most cases.
Regards,
Felix
> }
>
> static unsigned gmc_v12_0_get_vbios_fb_size(struct amdgpu_device *adev)
More information about the amd-gfx
mailing list