<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/msm/msm_gem_prime.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-11-13T20:37:16Z</updated>
<entry>
<title>drm/msm: Fix 32b size truncation</title>
<updated>2025-11-13T20:37:16Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2025-08-21T00:04:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36d85c2a139bf237a7cf3935e8d31233f4fc3f19'/>
<id>urn:sha1:36d85c2a139bf237a7cf3935e8d31233f4fc3f19</id>
<content type='text'>
[ Upstream commit 6d6a29a19b232e29b61a14d58b71fefc2e003fa4 ]

Somehow we never noticed this when arm64 became a thing, many years ago.

v2: also fix npages

Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Connor Abbott &lt;cwabbott0@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/669785/
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/msm: Defer VMA unmap for fb unpins</title>
<updated>2025-07-05T00:48:38Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2025-06-29T20:13:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bebfd53af0f7c8ea55094ba7b8b8b907024bb7b'/>
<id>urn:sha1:3bebfd53af0f7c8ea55094ba7b8b8b907024bb7b</id>
<content type='text'>
With the conversion to drm_gpuvm, we lost the lazy VMA cleanup, which
means that fb cleanup/unpin when pageflipping to new scanout buffers
immediately unmaps the scanout buffer.  This is costly (with tlbinv,
it can be 4-6ms for a 1080p scanout buffer, and more for higher
resolutions)!

To avoid this, introduce a vma_ref, which is incremented whenever
userspace has a GEM handle or dma-buf fd.  When unpinning if the
vm is the kms-&gt;vm we defer tearing down the VMA until the vma_ref
drops to zero.  If the buffer is still part of a flip-chain then
userspace will be holding some sort of reference to the BO, either
via a GEM handle and/or dma-buf fd.  So this avoids unmapping the VMA
when there is a strong possibility that it will be needed again.

Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661538/
</content>
</entry>
<entry>
<title>drm/msm: Add _NO_SHARE flag</title>
<updated>2025-07-05T00:48:36Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2025-06-29T20:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b58e12a66e47eaf95b31bbefbc260e5a0b3e638c'/>
<id>urn:sha1:b58e12a66e47eaf95b31bbefbc260e5a0b3e638c</id>
<content type='text'>
Buffers that are not shared between contexts can share a single resv
object.  This way drm_gpuvm will not track them as external objects, and
submit-time validating overhead will be O(1) for all N non-shared BOs,
instead of O(n).

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Signed-off-by: Rob Clark &lt;robin.clark@oss.qualcomm.com&gt;
Tested-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Reviewed-by: Antonino Maniscalco &lt;antomani103@gmail.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/661497/
</content>
</entry>
<entry>
<title>drm/msm: Test for imported buffers with drm_gem_is_imported()</title>
<updated>2025-04-14T08:53:11Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2025-03-17T13:06:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55eba86e11381af782830760774bc22868af20a0'/>
<id>urn:sha1:55eba86e11381af782830760774bc22868af20a0</id>
<content type='text'>
Instead of testing import_attach for imported GEM buffers, invoke
drm_gem_is_imported() to do the test. The helper tests the dma_buf
itself while import_attach is just an artifact of the import. Prepares
to make import_attach optional.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Cc: Abhinav Kumar &lt;quic_abhinavk@quicinc.com&gt;
Cc: Dmitry Baryshkov &lt;lumag@kernel.org&gt;
Cc: Sean Paul &lt;sean@poorly.run&gt;
Cc: Marijn Suijten &lt;marijn.suijten@somainline.org&gt;
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Acked-by: Dmitry Baryshkov &lt;dmitry.baryshkov@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20250317131923.238374-7-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()</title>
<updated>2024-03-11T12:33:50Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2024-02-27T10:14:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a78027847226493ea6f09a00875fa4871fd29e69'/>
<id>urn:sha1:a78027847226493ea6f09a00875fa4871fd29e69</id>
<content type='text'>
Acquire the buffer object's reservation lock in drm_gem_pin() and
remove locking the drivers' GEM callbacks where necessary. Same for
unpin().

DRM drivers and memory managers modified by this patch will now have
correct dma-buf locking semantics: the caller is responsible for
holding the reservation lock when calling the pin or unpin callback.

DRM drivers and memory managers that are not modified will now be
protected against concurent invocation of their pin and unpin callbacks.

PRIME does not implement struct dma_buf_ops.pin, which requires
the caller to hold the reservation lock. It does implement struct
dma_buf_ops.attach, which requires to callee to acquire the
reservation lock. The PRIME code uses drm_gem_pin(), so locks
are now taken as specified. Same for unpin and detach.

The patch harmonizes GEM pin and unpin to have non-interruptible
reservation locking across all drivers, as is already the case for
vmap and vunmap. This affects gem-shmem, gem-vram, loongson, qxl and
radeon.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Tested-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt; # virtio-gpu
Link: https://patchwork.freedesktop.org/patch/msgid/20240227113853.8464-10-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/msm: Acquire reservation lock in GEM pin/unpin callback</title>
<updated>2024-03-11T12:33:50Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2024-02-27T10:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45a10ad4e66221bf330b93a78a21cfcfc96f4e12'/>
<id>urn:sha1:45a10ad4e66221bf330b93a78a21cfcfc96f4e12</id>
<content type='text'>
Export msm_gem_pin_pages_locked() and acquire the reservation lock
directly in GEM pin callback. Same for unpin. Prepares for further
changes.

Dma-buf locking semantics require callers to hold the buffer's
reservation lock when invoking the pin and unpin callbacks. Prepare
msm accordingly by pushing locking out of the implementation. A
follow-up patch will fix locking for all GEM code at once.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt;
Tested-by: Dmitry Osipenko &lt;dmitry.osipenko@collabora.com&gt; # virtio-gpu
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Zack Rusin &lt;zack.rusin@broadcom.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240227113853.8464-5-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/msm/gem: Fix double resv lock aquire</title>
<updated>2024-02-01T22:59:35Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2024-01-31T15:08:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03facb39d6c6433a78d0f79c7a146b1e6a61943e'/>
<id>urn:sha1:03facb39d6c6433a78d0f79c7a146b1e6a61943e</id>
<content type='text'>
Since commit 79e2cf2e7a19 ("drm/gem: Take reservation lock for vmap/vunmap
operations"), the resv lock is already held in the prime vmap path, so
don't try to grab it again.

v2: This applies to vunmap path as well
v3: Fix fixes commit

Fixes: 79e2cf2e7a19 ("drm/gem: Take reservation lock for vmap/vunmap operations")
Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Patchwork: https://patchwork.freedesktop.org/patch/576642/
</content>
</entry>
<entry>
<title>drm: Remove struct drm_driver.gem_prime_mmap</title>
<updated>2023-06-19T11:56:40Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2023-06-13T14:51:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0adec22702d497385dbdc52abb165f379a00efba'/>
<id>urn:sha1:0adec22702d497385dbdc52abb165f379a00efba</id>
<content type='text'>
All drivers initialize this field with drm_gem_prime_mmap(). Call
the function directly and remove the field. Simplifies the code and
resolves a long-standing TODO item.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230613150441.17720-3-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/msm: Initialize mmap offset after constructing the buffer object</title>
<updated>2023-06-19T11:56:32Z</updated>
<author>
<name>Thomas Zimmermann</name>
</author>
<published>2023-06-13T14:51:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=734458b7620161c07acb801a396d0a4837bcdbd9'/>
<id>urn:sha1:734458b7620161c07acb801a396d0a4837bcdbd9</id>
<content type='text'>
Only the msm driver provides its own implementation of gem_prime_mmap
from struct drm_driver. All other drivers use the drm_gem_prime_mmap()
helper.

Initialize the mmap offset when constructing the buffer object in msm
and reduce the gem_prime_mmap code to the generic helper. Prepares
msm for the removal of struct drm_driver.gem_prime_mmap.

Signed-off-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Reviewed-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20230613150441.17720-2-tzimmermann@suse.de
</content>
</entry>
<entry>
<title>drm/msm/gem: Rename to pin/unpin_pages</title>
<updated>2022-08-27T16:32:44Z</updated>
<author>
<name>Rob Clark</name>
</author>
<published>2022-08-02T15:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7cd5ee9aa77d9639566c721ad6dda8c25673235'/>
<id>urn:sha1:e7cd5ee9aa77d9639566c721ad6dda8c25673235</id>
<content type='text'>
Since that is what these fxns actually do.. they are getting *pinned*
pages (as opposed to cases where we need pages, but don't need them
pinned, like CPU mappings).

Signed-off-by: Rob Clark &lt;robdclark@chromium.org&gt;
Patchwork: https://patchwork.freedesktop.org/patch/496121/
Link: https://lore.kernel.org/r/20220802155152.1727594-7-robdclark@gmail.com
</content>
</entry>
</feed>
