1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-30 17:16:30 +00:00

drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces

From Vitaly Prosyak
d9db9abf6667a1ad2b827635123ecb63ea86184f in linux-6.12.y/6.12.59
22a36e660d014925114feb09a2680bb3c2d1e279 in mainline linux
This commit is contained in:
jsg
2025-11-25 02:21:23 +00:00
parent 1fbfb4fd43
commit 5a2948c1d8

View File

@@ -84,6 +84,18 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
/*
* Disable peer-to-peer access for DCC-enabled VRAM surfaces on GFX12+.
* Such buffers cannot be safely accessed over P2P due to device-local
* compression metadata. Fallback to system-memory path instead.
* Device supports GFX12 (GC 12.x or newer)
* BO was created with the AMDGPU_GEM_CREATE_GFX12_DCC flag
*
*/
if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0) &&
bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
attach->peer2peer = false;
if (!amdgpu_dmabuf_is_xgmi_accessible(attach_adev, bo) &&
pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
attach->peer2peer = false;