All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] drm/msm: DMABUF_DEBUG fixes
@ 2026-10-30 21:32 Rob Clark
  2026-10-30 21:32 ` [PATCH v4 1/6] drm/msm: Cleanup if pages_to_sg() fails Rob Clark
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Rob Clark @ 2026-10-30 21:32 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-arm-msm, freedreno, Jianfeng Liu, Christian König,
	Dmitry Baryshkov, Rob Clark, Abhinav Kumar, David Airlie,
	Jessica Zhang, open list, Marijn Suijten, Sean Paul,
	Simona Vetter

With DMABUF_DEBUG=y, the page information is stripped from the sgt that
we get for an externally allocated buffer that is dma-buf imported (as
opposed to an exported GEM buffer that is re-imported).  This is a bit
unfortunate, since we need that information for mapping the buffer in
both paths:

1. Userspace GPU pgtables (TTBR0), where we use io_pgtable directly.
   Fortunately this we can fix ourselves easily.

2. Iommu managed pgtables (scanout, kernel GPU buffers (TTBR1)).  In
   normal usage that iommu subsystem envisions the dma-mapping and
   iommu-mapping are combined.  We can't really work around this but
   we can stop trying to pretend to be a normal iommu user and just
   go directly to the iommu_domain_ops.

This all depends on being dma_map_direct() for the dma_map_sgtable()
to work.  This should be the case on modern things that use arm-smmu.
It's less clear when it comes to older pre-arm-smmu hw.  It's possible
that this series causes those things to catch fire.  If so, look to
commit 0e764a01015d ("iommu/arm-smmu: Allow client devices to select
direct mapping") for inspiration.

Note, for older pre-arm-smmu devices, this iommu series is a dependency:
https://lore.kernel.org/all/20261029212344.346069-1-robin.clark@oss.qualcomm.com/

v4:
- Fix get_pages() error path
- Link to v3: https://lore.kernel.org/all/20261027230452.130031-1-robin.clark@oss.qualcomm.com/

v3:
- Fixing missing tlb flushes in error paths harder
- Do a single dma_map/unmap_sgtable()
- More paranoid error checking on map path
- Link to v2: https://lore.kernel.org/all/20261027152821.51144-1-robin.clark@oss.qualcomm.com/

v2:
- Fix missing tlb flushes in error paths
- Link to v1: https://lore.kernel.org/all/20261006131000.81501-1-robin.clark@oss.qualcomm.com/

Rob Clark (6):
  drm/msm: Cleanup if pages_to_sg() fails
  drm/msm/gem: dma_map/unmap_sgtable()
  drm/msm: Extract out map/unmap helpers
  drm/msm: Convert iommu map/unmap to helpers
  drm/msm: Convert map helper to use dma-address
  drm/msm: Treat !mapped as an error

 drivers/gpu/drm/msm/msm_gem.c   |  96 +++++++--------
 drivers/gpu/drm/msm/msm_iommu.c | 210 +++++++++++++++++++++-----------
 2 files changed, 187 insertions(+), 119 deletions(-)

-- 
2.56.0


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

end of thread, other threads:[~2026-10-30 21:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 21:32 [PATCH v4 0/6] drm/msm: DMABUF_DEBUG fixes Rob Clark
2026-10-30 21:32 ` [PATCH v4 1/6] drm/msm: Cleanup if pages_to_sg() fails Rob Clark
2026-10-30 21:32 ` [PATCH v4 2/6] drm/msm/gem: dma_map/unmap_sgtable() Rob Clark
2026-10-30 21:46   ` sashiko-bot
2026-10-30 21:32 ` [PATCH v4 3/6] drm/msm: Extract out map/unmap helpers Rob Clark
2026-10-30 21:32 ` [PATCH v4 4/6] drm/msm: Convert iommu map/unmap to helpers Rob Clark
2026-10-30 21:49   ` sashiko-bot
2026-10-30 21:32 ` [PATCH v4 5/6] drm/msm: Convert map helper to use dma-address Rob Clark
2026-10-30 21:57   ` sashiko-bot
2026-10-30 21:32 ` [PATCH v4 6/6] drm/msm: Treat !mapped as an error Rob Clark
2026-10-30 21:54   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.