<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c, branch v6.16</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.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-05-01T15:01:46Z</updated>
<entry>
<title>drm/amdgpu: Fail DMABUF map of XGMI-accessible memory</title>
<updated>2025-05-01T15:01:46Z</updated>
<author>
<name>Felix Kuehling</name>
<email>felix.kuehling@amd.com</email>
</author>
<published>2025-04-17T16:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9397204ffae887bd557e7053609174b3eb9d6f5c'/>
<id>urn:sha1:9397204ffae887bd557e7053609174b3eb9d6f5c</id>
<content type='text'>
If peer memory is XGMI-accessible, we should never access it through PCIe
P2P DMA mappings. PCIe P2P is slower, has different coherence behaviour,
limited or no support for atomics, or may not work at all. Fail with a
warning if DMABUF mappings of such memory are attempted.

Signed-off-by: Felix Kuehling &lt;felix.kuehling@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 dbe4c63689bc6b5fd3ab72650ea4b6a667e96a68)
</content>
</entry>
<entry>
<title>drm/amdgpu: Allow P2P access through XGMI</title>
<updated>2025-04-22T20:47:12Z</updated>
<author>
<name>Felix Kuehling</name>
<email>felix.kuehling@amd.com</email>
</author>
<published>2025-04-16T04:19:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a92741e72f91b904c1d8c3d409ed8dbe9c1f2b26'/>
<id>urn:sha1:a92741e72f91b904c1d8c3d409ed8dbe9c1f2b26</id>
<content type='text'>
If peer memory is accessible through XGMI, allow leaving it in VRAM
rather than forcing its migration to GTT on DMABuf attachment.

Signed-off-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt;
Tested-by: Hao (Claire) Zhou &lt;hao.zhou@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 372c8d72c3680fdea3fbb2d6b089f76b4a6d596a)
</content>
</entry>
<entry>
<title>drm/amdgpu: Don't pin VRAM without DMABUF_MOVE_NOTIFY</title>
<updated>2025-04-22T20:44:28Z</updated>
<author>
<name>Felix Kuehling</name>
<email>felix.kuehling@amd.com</email>
</author>
<published>2025-04-16T03:58:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e56935b519b2fbbca1cafa0cef3c7c3d062f62d'/>
<id>urn:sha1:5e56935b519b2fbbca1cafa0cef3c7c3d062f62d</id>
<content type='text'>
Pinning of VRAM is for peer devices that don't support dynamic attachment
and move notifiers. But it requires that all such peer devices are able to
access VRAM via PCIe P2P. Any device without P2P access requires migration
to GTT, which fails if the memory is already pinned for another peer
device.

Sharing between GPUs should not require pinning in VRAM. However, if
DMABUF_MOVE_NOTIFY is disabled in the kernel build, even DMABufs shared
between GPUs must be pinned, which can lead to failures and functional
regressions on systems where some peer GPUs are not P2P accessible.

Disable VRAM pinning if move notifiers are disabled in the kernel build
to fix regressions when sharing BOs between GPUs.

Signed-off-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt;
Tested-by: Hao (Claire) Zhou &lt;hao.zhou@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 05185812ae3695fe049c14847ce3cbeccff1bf2e)
</content>
</entry>
<entry>
<title>drm/amdgpu: Use allowed_domains for pinning dmabufs</title>
<updated>2025-04-22T20:44:02Z</updated>
<author>
<name>Felix Kuehling</name>
<email>felix.kuehling@amd.com</email>
</author>
<published>2025-04-17T14:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cf3c602df88b471178a5717b17e529d09acad84'/>
<id>urn:sha1:5cf3c602df88b471178a5717b17e529d09acad84</id>
<content type='text'>
When determining the domains for pinning DMABufs, filter allowed_domains
and fail with a warning if VRAM is forbidden and GTT is not an allowed
domain.

Fixes: f5e7fabd1f5c ("drm/amdgpu: allow pinning DMA-bufs into VRAM if all importers can do P2P")
Suggested-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Felix Kuehling &lt;felix.kuehling@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 3940796a6eefa555fec688a4adee5659ef9fa431)
</content>
</entry>
<entry>
<title>drm/amdgpu: allow pinning DMA-bufs into VRAM if all importers can do P2P</title>
<updated>2025-04-07T19:18:30Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2025-01-09T16:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5e7fabd1f5c65b2e077efcdb118cfa67eae7311'/>
<id>urn:sha1:f5e7fabd1f5c65b2e077efcdb118cfa67eae7311</id>
<content type='text'>
Try pinning into VRAM to allow P2P with RDMA NICs without ODP
support if all attachments can do P2P. If any attachment can't do
P2P just pin into GTT instead.

Acked-by: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt;
Reviewed-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt;
Tested-by: Pak Nin Lui &lt;pak.lui@amd.com&gt;
Cc: Simona Vetter &lt;simona.vetter@ffwll.ch&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu/dma_buf: fix page_link check</title>
<updated>2025-04-07T18:31:45Z</updated>
<author>
<name>Matthew Auld</name>
<email>matthew.auld@intel.com</email>
</author>
<published>2025-04-07T14:18:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c0dd8a9253fadfb8e5357217d085f1989da4ef0a'/>
<id>urn:sha1:c0dd8a9253fadfb8e5357217d085f1989da4ef0a</id>
<content type='text'>
The page_link lower bits of the first sg could contain something like
SG_END, if we are mapping a single VRAM page or contiguous blob which
fits into one sg entry. Rather pull out the struct page, and use that in
our check to know if we mapped struct pages vs VRAM.

Fixes: f44ffd677fb3 ("drm/amdgpu: add support for exporting VRAM using DMA-buf v3")
Signed-off-by: Matthew Auld &lt;matthew.auld@intel.com&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: amd-gfx@lists.freedesktop.org
Cc: &lt;stable@vger.kernel.org&gt; # v5.8+
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: track bo memory stats at runtime</title>
<updated>2024-12-19T15:56:28Z</updated>
<author>
<name>Yunxiang Li</name>
<email>Yunxiang.Li@amd.com</email>
</author>
<published>2024-12-19T15:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74ef9527bd87ead62deabe749a6d867af748d448'/>
<id>urn:sha1:74ef9527bd87ead62deabe749a6d867af748d448</id>
<content type='text'>
Before, every time fdinfo is queried we try to lock all the BOs in the
VM and calculate memory usage from scratch. This works okay if the
fdinfo is rarely read and the VMs don't have a ton of BOs. If either of
these conditions is not true, we get a massive performance hit.

In this new revision, we track the BOs as they change states. This way
when the fdinfo is queried we only need to take the status lock and copy
out the usage stats with minimal impact to the runtime performance. With
this new approach however, we would no longer be able to track active
buffers.

Signed-off-by: Yunxiang Li &lt;Yunxiang.Li@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241219151411.1150-6-Yunxiang.Li@amd.com
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: remove unused function parameter</title>
<updated>2024-12-19T15:56:25Z</updated>
<author>
<name>Yunxiang Li</name>
<email>Yunxiang.Li@amd.com</email>
</author>
<published>2024-12-19T15:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a541a6e865ecd8dfd8df6eeb134cc20e7139d329'/>
<id>urn:sha1:a541a6e865ecd8dfd8df6eeb134cc20e7139d329</id>
<content type='text'>
amdgpu_vm_bo_invalidate doesn't use the adev parameter and not all
callers have a reference to adev handy, so remove it for cleanliness.

Signed-off-by: Yunxiang Li &lt;Yunxiang.Li@amd.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20241219151411.1150-5-Yunxiang.Li@amd.com
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
</content>
</entry>
<entry>
<title>drm/amdgpu: revert "take runtime pm reference when we attach a buffer" v2</title>
<updated>2024-06-14T20:17:13Z</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2024-06-05T11:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=030631e97b209481edbac38000d2a60fd340f6b1'/>
<id>urn:sha1:030631e97b209481edbac38000d2a60fd340f6b1</id>
<content type='text'>
This reverts commit b8c415e3bf98 ("drm/amdgpu: take runtime pm reference
when we attach a buffer") and commit 425285d39afd ("drm/amdgpu: add amdgpu
runpm usage trace for separate funcs").

Taking a runtime pm reference for DMA-buf is actually completely
unnecessary and even dangerous.

The problem is that calling pm_runtime_get_sync() from the DMA-buf
callbacks is illegal because we have the reservation locked here
which is also taken during resume. So this would deadlock.

When the buffer is in GTT it is still accessible even when the GPU
is powered down and when it is in VRAM the buffer gets migrated to
GTT before powering down.

The only use case which would make it mandatory to keep the runtime
pm reference would be if we pin the buffer into VRAM, and that's not
something we currently do.

v2: improve the commit message

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
CC: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drm/amdgpu: Reduce mem_type to domain double indirection</title>
<updated>2024-05-17T21:40:38Z</updated>
<author>
<name>Tvrtko Ursulin</name>
<email>tvrtko.ursulin@igalia.com</email>
</author>
<published>2024-05-06T16:59:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8fb0efb10184c8121719247e5d59e68e7f5617de'/>
<id>urn:sha1:8fb0efb10184c8121719247e5d59e68e7f5617de</id>
<content type='text'>
All apart from AMDGPU_GEM_DOMAIN_GTT memory domains map 1:1 to TTM
placements. And the former be either AMDGPU_PL_PREEMPT or TTM_PL_TT,
depending on AMDGPU_GEM_CREATE_PREEMPTIBLE.

Simplify a few places in the code which convert the TTM placement into
a domain by checking against the current placement directly.

In the conversion AMDGPU_PL_PREEMPT either does not have to be handled
because amdgpu_mem_type_to_domain() cannot return that value anyway.

v2:
 * Remove AMDGPU_PL_PREEMPT handling.

v3:
 * Rebase.

Signed-off-by: Tvrtko Ursulin &lt;tvrtko.ursulin@igalia.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt; # v1
Reviewed-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt; # v2
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
</content>
</entry>
</feed>
