]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Thu, 6 Nov 2025 17:35:53 +0000 (12:35 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Nov 2025 02:53:27 +0000 (21:53 -0500)
commit9dff2bb709e6fbd97e263fd12bf12802d2b5a0cf
tree7a4a1dffc93d0edf648ed0892427ec1bcaa02503
parent815e260a18a3af4dab59025ee99a7156c0e8b5e0
drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces

Certain multi-GPU configurations (especially GFX12) may hit
data corruption when a DCC-compressed VRAM surface is shared across GPUs
using peer-to-peer (P2P) DMA transfers.

Such surfaces rely on device-local metadata and cannot be safely accessed
through a remote GPU’s page tables. Attempting to import a DCC-enabled
surface through P2P leads to incorrect rendering or GPU faults.

This change disables P2P for DCC-enabled VRAM buffers that are contiguous
and allocated on GFX12+ hardware.  In these cases, the importer falls back
to the standard system-memory path, avoiding invalid access to compressed
surfaces.

Future work could consider optional migration (VRAM→System→VRAM) if a
performance regression is observed when `attach->peer2peer = false`.

Tested on:
 - Dual RX 9700 XT (Navi4x) setup
 - GNOME and Wayland compositor scenarios
 - Confirmed no corruption after disabling P2P under these conditions
v2: Remove check TTM_PL_VRAM & TTM_PL_FLAG_CONTIGUOUS.
v3: simplify for upsteam and fix ip version check (Alex)

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c