mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] drm/msm/gem: Drop use of pages for imported dma-bufs
@ 2026-09-26 18:30 Rob Clark
  2026-09-26 18:30 ` [PATCH 1/6] drm/msm/gem: Add helper to check if resident Rob Clark
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Rob Clark @ 2026-09-26 18:30 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-arm-msm, freedreno, Jianfeng Liu, Christian König,
	Rob Clark, Abel Vesa, Abhinav Kumar, Andrei Kuchynski,
	Benson Leung, Chia-Lin Kao (AceLan),
	David Airlie, Dmitry Baryshkov, Greg Kroah-Hartman,
	Heikki Krogerus, Hsin-Te Yuan, Jessica Zhang, Johan Hovold,
	moderated list:DMA BUFFER SHARING
	FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b, open list,
	open list:DMA BUFFER SHARING
	FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b,
	open list:USB TYPEC CLASS, Marijn Suijten, Pooja Katiyar,
	Sean Paul, Simona Vetter, Sumit Semwal

The use of msm_obj->pages _mostly_ served to mark that the obj is
resident in memory.  Mapping to the GPU, etc, all works in terms of
the sgt.

The exception was the fault path.  Resolve this by using dma_buf_mmap()
for mmap'ing imported buffers, like we are supposed to.  With that and
a bit more cleanup we can drop the use of drm_prime_sg_to_page_array().

This doesn't solve the issues with DMABUF_DEBUG, mapping to the GPU,
either via iommu_map_sgtable() (display, and TTBR1 for GPU, aka the
kernel managed mappings), or msm_iommu_pagetable_map() (userspace
managed mappings), still requires pages under the hood.  That will
be harder to solve.  But this is a step along the way.

Lightly tested.. in that I don't actually have a good way to test
importing buffers that weren't first exported by drm/msm.  And I'm
headed to XDC soon.

Rob Clark (6):
  drm/msm/gem: Add helper to check if resident
  drm/msm/gem: Mmap imported dma-bufs via the exporter
  drm/msm/gem: Use get_pages() directly in vmap path
  drm/msm/gem: Stop exposing a page array
  drm/msm/gem: Stop calling get_pages() for imported dma-bufs
  drm/msm/gem: Drop use of drm_prime_sg_to_page_array()

 drivers/gpu/drm/msm/msm_gem.c       | 107 +++++++++++++++++-----------
 drivers/gpu/drm/msm/msm_gem.h       |  10 ++-
 drivers/gpu/drm/msm/msm_gem_prime.c |   5 +-
 drivers/gpu/drm/msm/msm_gem_vma.c   |   8 +--
 4 files changed, 78 insertions(+), 52 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-26 18:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-26 18:30 [PATCH 0/6] drm/msm/gem: Drop use of pages for imported dma-bufs Rob Clark
2026-09-26 18:30 ` [PATCH 1/6] drm/msm/gem: Add helper to check if resident Rob Clark
2026-09-26 18:30 ` [PATCH 2/6] drm/msm/gem: Mmap imported dma-bufs via the exporter Rob Clark
2026-09-26 18:30 ` [PATCH 3/6] drm/msm/gem: Use get_pages() directly in vmap path Rob Clark
2026-09-26 18:30 ` [PATCH 4/6] drm/msm/gem: Stop exposing a page array Rob Clark
2026-09-26 18:30 ` [PATCH 5/6] drm/msm/gem: Stop calling get_pages() for imported dma-bufs Rob Clark
2026-09-26 18:30 ` [PATCH 6/6] drm/msm/gem: Drop use of drm_prime_sg_to_page_array() Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®