ac/gpu_info: Fix determining when CP DMA supports sparse

Change has_cp_dma_with_null_prt_bug to cp_dma_supports_sparse
to know when CP DMA supports sparse. CP DMA doesn't support
sparse on any gfx6-9 chip.

Sources:
- d2669628 already documented this on gfx6 in 2018
- e259f405 added a radeonsi workaround for gfx9 in 2023
- 235f70e4 added a radv workaround for Polaris in 2025

Now RADV will use compute copy and fill for sparse resources
on all gfx6-9 chips (previously only did on Polaris and newer).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38553>
This commit is contained in:
Timur Kristóf 2025-11-20 14:23:58 +01:00
parent cd72ce3213
commit 292460670a
3 changed files with 6 additions and 6 deletions

View file

@ -1059,10 +1059,10 @@ ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info,
*/
info->has_attr_ring_wait_bug = info->gfx_level == GFX11 || info->gfx_level == GFX11_5;
/* On GFX8-9, CP DMA is broken with NULL PRT page, it doesn't read 0 and it
* doesn't discard writes which causes GPU hangs.
/* On GFX8-9, CP DMA doesn't support NULL PRT pages:
* it doesn't read 0 and doesn't discard writes, causing GPU hangs.
*/
info->has_cp_dma_with_null_prt_bug = info->family >= CHIP_POLARIS10 && info->gfx_level <= GFX9;
info->cp_dma_supports_sparse = info->gfx_level >= GFX10;
/* When LLVM is fixed to handle multiparts shaders, this value will depend
* on the known good versions of LLVM. Until then, enable the equivalent WA

View file

@ -119,7 +119,7 @@ struct radeon_info {
bool has_ngg_passthru_no_msg;
bool has_export_conflict_bug;
bool has_attr_ring_wait_bug;
bool has_cp_dma_with_null_prt_bug;
bool cp_dma_supports_sparse;
bool has_vrs_ds_export_bug;
bool has_taskmesh_indirect0_bug;
bool sdma_supports_sparse; /* Whether SDMA can safely access sparse resources. */

View file

@ -273,8 +273,8 @@ radv_is_compute_required(const struct radv_device *device, enum radv_copy_flags
{
const struct radv_physical_device *pdev = radv_device_physical(device);
/* On GFX8-9, CP DMA is broken with NULL PRT pages and the workaround is to use compute. */
return pdev->info.has_cp_dma_with_null_prt_bug &&
/* Use compute when CP DMA doesn't support sparse. */
return !pdev->info.cp_dma_supports_sparse &&
((src_copy_flags & RADV_COPY_FLAGS_SPARSE) || (dst_copy_flags & RADV_COPY_FLAGS_SPARSE));
}