[PATCH v2 0/6] drm/msm/gem: Drop use of pages for imported dma-bufs
From: Rob Clark
Date: Fri Oct 02 2026 - 11:31:29 EST
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.
Changes in v2:
- Drop dead code spotted by sashiko in 4/6
- Collect tags
- Link to v1: https://lore.kernel.org/all/20260926183051.25754-1-robin.clark@xxxxxxxxxxxxxxxx/
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 | 9 +--
drivers/gpu/drm/msm/msm_gem_vma.c | 8 +--
4 files changed, 78 insertions(+), 56 deletions(-)
--
2.55.0