<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c, branch v6.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2026-01-14T19:51:36Z</updated>
<entry>
<title>Revert duplicate "drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces"</title>
<updated>2026-01-14T19:51:36Z</updated>
<author>
<name>Peter Colberg</name>
<email>pcolberg@redhat.com</email>
</author>
<published>2025-12-22T17:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c8120015270d8a31c335c7137977749e5e8cd30'/>
<id>urn:sha1:9c8120015270d8a31c335c7137977749e5e8cd30</id>
<content type='text'>
This reverts commit 22a36e660d014925114feb09a2680bb3c2d1e279 once,
which was merged twice due to an incorrect backmerge resolution.

Fixes: ce0478b02ed2 ("Merge tag 'v6.18-rc6' into drm-next")
Signed-off-by: Peter Colberg &lt;pcolberg@redhat.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
(cherry picked from commit 38a0f4cf8c6147fd10baa206ab349f8ff724e391)
</content>
</entry>
<entry>
<title>Merge tag 'v6.18-rc6' into drm-next</title>
<updated>2025-11-20T22:55:08Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2025-11-20T22:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce0478b02ed29465c1de3d03c3eea721355f9d2d'/>
<id>urn:sha1:ce0478b02ed29465c1de3d03c3eea721355f9d2d</id>
<content type='text'>
Linux 6.18-rc6

Backmerge in order to merge msm next

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces</title>
<updated>2025-11-12T03:49:19Z</updated>
<author>
<name>Vitaly Prosyak</name>
<email>vitaly.prosyak@amd.com</email>
</author>
<published>2025-11-06T17:35:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22a36e660d014925114feb09a2680bb3c2d1e279'/>
<id>urn:sha1:22a36e660d014925114feb09a2680bb3c2d1e279</id>
<content type='text'>
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-&gt;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 &amp; TTM_PL_FLAG_CONTIGUOUS.
v3: simplify for upsteam and fix ip version check (Alex)

Suggested-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Vitaly Prosyak &lt;vitaly.prosyak@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
(cherry picked from commit 9dff2bb709e6fbd97e263fd12bf12802d2b5a0cf)
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM surfaces</title>
<updated>2025-11-12T02:53:27Z</updated>
<author>
<name>Vitaly Prosyak</name>
<email>vitaly.prosyak@amd.com</email>
</author>
<published>2025-11-06T17:35:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9dff2bb709e6fbd97e263fd12bf12802d2b5a0cf'/>
<id>urn:sha1:9dff2bb709e6fbd97e263fd12bf12802d2b5a0cf</id>
<content type='text'>
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-&gt;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 &amp; TTM_PL_FLAG_CONTIGUOUS.
v3: simplify for upsteam and fix ip version check (Alex)

Suggested-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Vitaly Prosyak &lt;vitaly.prosyak@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: lock bo before calling amdgpu_vm_bo_update_shared</title>
<updated>2025-11-04T16:53:21Z</updated>
<author>
<name>Pierre-Eric Pelloux-Prayer</name>
<email>pierre-eric.pelloux-prayer@amd.com</email>
</author>
<published>2025-10-28T13:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36ffc58b8a8704e690a0ce679db26baa5759256f'/>
<id>urn:sha1:36ffc58b8a8704e690a0ce679db26baa5759256f</id>
<content type='text'>
BO's reservation object must be locked before using
amdgpu_vm_bo_update_shared otherwise dma_resv_assert_held will
complain in amdgpu_vm_update_shared.

Signed-off-by: Pierre-Eric Pelloux-Prayer &lt;pierre-eric.pelloux-prayer@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v6.17-rc6' into drm-next</title>
<updated>2025-09-15T07:51:07Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2025-09-15T07:51:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d9f0083f7a5a31d91d501467b499bb8c4b25bdf'/>
<id>urn:sha1:0d9f0083f7a5a31d91d501467b499bb8c4b25bdf</id>
<content type='text'>
This is a backmerge of Linux 6.17-rc6, needed for msm,
also requested by misc.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>amdgpu: populate buffers before exporting them.</title>
<updated>2025-09-11T00:04:31Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2025-09-04T02:16:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=619ddf57cfddf81ffb75905cc5f533e61206b10c'/>
<id>urn:sha1:619ddf57cfddf81ffb75905cc5f533e61206b10c</id>
<content type='text'>
Before exporting a buffer, make sure it has been populated with
pages at least once.

While discussing cgroups we noticed a problem where you could export
a BO to a dma-buf without having it ever being backed or accounted for.

This meant in low memory situations or eventually with cgroups, a
lower privledged process might cause the compositor to try and allocate
a lot of memory on it's behalf and this could fail. At least make
sure the exporter has managed to allocate the RAM at least once
before exporting the object.

This only applies currently to TTM_PL_SYSTEM objects, because
GTT objects get populated on first validate, and VRAM doesn't
use TT.

Reviewed-by: Christian Koenig &lt;christian.koenig@amd.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://lore.kernel.org/r/20250904021643.2050497-2-airlied@gmail.com
</content>
</entry>
<entry>
<title>drm/amdgpu: Pin buffers while vmap'ing exported dma-buf objects</title>
<updated>2025-08-22T12:05:31Z</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-08-21T06:40:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08fb45446ebf1e2e435f95163c59d692acb0b514'/>
<id>urn:sha1:08fb45446ebf1e2e435f95163c59d692acb0b514</id>
<content type='text'>
Current dma-buf vmap semantics require that the mapped buffer remains
in place until the corresponding vunmap has completed.

For GEM-SHMEM, this used to be guaranteed by a pin operation while creating
an S/G table in import. GEM-SHMEN can now import dma-buf objects without
creating the S/G table, so the pin is missing. Leads to page-fault errors,
such as the one shown below.

[  102.101726] BUG: unable to handle page fault for address: ffffc90127000000
[...]
[  102.157102] RIP: 0010:udl_compress_hline16+0x219/0x940 [udl]
[...]
[  102.243250] Call Trace:
[  102.245695]  &lt;TASK&gt;
[  102.2477V95]  ? validate_chain+0x24e/0x5e0
[  102.251805]  ? __lock_acquire+0x568/0xae0
[  102.255807]  udl_render_hline+0x165/0x341 [udl]
[  102.260338]  ? __pfx_udl_render_hline+0x10/0x10 [udl]
[  102.265379]  ? local_clock_noinstr+0xb/0x100
[  102.269642]  ? __lock_release.isra.0+0x16c/0x2e0
[  102.274246]  ? mark_held_locks+0x40/0x70
[  102.278177]  udl_primary_plane_helper_atomic_update+0x43e/0x680 [udl]
[  102.284606]  ? __pfx_udl_primary_plane_helper_atomic_update+0x10/0x10 [udl]
[  102.291551]  ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170
[  102.297208]  ? lockdep_hardirqs_on+0x88/0x130
[  102.301554]  ? _raw_spin_unlock_irq+0x24/0x50
[  102.305901]  ? wait_for_completion_timeout+0x2bb/0x3a0
[  102.311028]  ? drm_atomic_helper_calc_timestamping_constants+0x141/0x200
[  102.317714]  ? drm_atomic_helper_commit_planes+0x3b6/0x1030
[  102.323279]  drm_atomic_helper_commit_planes+0x3b6/0x1030
[  102.328664]  drm_atomic_helper_commit_tail+0x41/0xb0
[  102.333622]  commit_tail+0x204/0x330
[...]
[  102.529946] ---[ end trace 0000000000000000 ]---
[  102.651980] RIP: 0010:udl_compress_hline16+0x219/0x940 [udl]

In this stack strace, udl (based on GEM-SHMEM) imported and vmap'ed a
dma-buf from amdgpu. Amdgpu relocated the buffer, thereby invalidating the
mapping.

Provide a custom dma-buf vmap method in amdgpu that pins the object before
mapping it's buffer's pages into kernel address space. Do the opposite in
vunmap.

Note that dma-buf vmap differs from GEM vmap in how it handles relocation.
While dma-buf vmap keeps the buffer in place, GEM vmap requires the caller
to keep the buffer in place. Hence, this fix is in amdgpu's dma-buf code
instead of its GEM code.

A discussion of various approaches to solving the problem is available
at [1].

v3:
- try (GTT | VRAM); drop CPU domain (Christian)
v2:
- only use mapable domains (Christian)
- try pinning to domains in preferred order

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Fixes: 660cd44659a0 ("drm/shmem-helper: Import dmabuf without mapping its sg_table")
Reported-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Closes: https://lore.kernel.org/dri-devel/ba1bdfb8-dbf7-4372-bdcb-df7e0511c702@suse.de/
Cc: Shixiong Ou &lt;oushixiong@kylinos.cn&gt;
Cc: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Maarten Lankhorst &lt;maarten.lankhorst@linux.intel.com&gt;
Cc: Maxime Ripard &lt;mripard@kernel.org&gt;
Cc: David Airlie &lt;airlied@gmail.com&gt;
Cc: Simona Vetter &lt;simona@ffwll.ch&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: "Christian König" &lt;christian.koenig@amd.com&gt;
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Link: https://lore.kernel.org/dri-devel/9792c6c3-a2b8-4b2b-b5ba-fba19b153e21@suse.de/ # [1]
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://lore.kernel.org/r/20250821064031.39090-1-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>Revert "drm/amdgpu: Use dma_buf from GEM object instance"</title>
<updated>2025-08-13T09:14:17Z</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-07-15T08:26:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3eb61d7cb74cea2ea697363669fa256937164758'/>
<id>urn:sha1:3eb61d7cb74cea2ea697363669fa256937164758</id>
<content type='text'>
This reverts commit 515986100d176663d0a03219a3056e4252f729e6.

The dma_buf field in struct drm_gem_object is not stable over the
object instance's lifetime. The field becomes NULL when user space
releases the final GEM handle on the buffer object. This resulted
in a NULL-pointer deref.

Workarounds in commit 5307dce878d4 ("drm/gem: Acquire references on
GEM handles for framebuffers") and commit f6bfc9afc751 ("drm/framebuffer:
Acquire internal references on GEM handles") only solved the problem
partially. They especially don't work for buffer objects without a DRM
framebuffer associated.

Hence, this revert to going back to using .import_attach-&gt;dmabuf.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://lore.kernel.org/r/20250715082635.34974-1-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/amdgpu: Use dma_buf from GEM object instance</title>
<updated>2025-06-30T15:55:16Z</updated>
<author>
<name>Thomas Zimmermann</name>
<email>tzimmermann@suse.de</email>
</author>
<published>2025-06-25T08:42:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=515986100d176663d0a03219a3056e4252f729e6'/>
<id>urn:sha1:515986100d176663d0a03219a3056e4252f729e6</id>
<content type='text'>
Avoid dereferencing struct drm_gem_object.import_attach for the
imported dma-buf. The dma_buf field in the GEM object instance refers
to the same buffer. Prepares to make import_attach an implementation
detail of PRIME.

Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
</feed>
