From: Rob Clark <robin.clark@oss.qualcomm.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
"Jianfeng Liu" <liujianfeng1994@gmail.com>,
"Christian König" <christian.koenig@amd.com>,
"Dmitry Baryshkov" <lumag@kernel.org>,
"Rob Clark" <robin.clark@oss.qualcomm.com>,
"Abhinav Kumar" <abhinav.kumar@linux.dev>,
"David Airlie" <airlied@gmail.com>,
"Jessica Zhang" <jesszhan0024@gmail.com>,
linux-kernel@vger.kernel.org (open list),
"Marijn Suijten" <marijn.suijten@somainline.org>,
"Sean Paul" <sean@poorly.run>, "Simona Vetter" <simona@ffwll.ch>
Subject: [PATCH v3 0/6] drm/msm: DMABUF_DEBUG fixes
Date: Tue, 27 Oct 2026 16:04:43 -0700 [thread overview]
Message-ID: <20261027230452.130031-1-robin.clark@oss.qualcomm.com> (raw)
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.
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 | 93 +++++++-------
drivers/gpu/drm/msm/msm_iommu.c | 210 +++++++++++++++++++++-----------
2 files changed, 184 insertions(+), 119 deletions(-)
--
2.56.0
next reply other threads:[~2026-10-27 23:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 23:04 Rob Clark [this message]
2026-10-27 23:04 ` [PATCH v3 1/6] drm/msm: Cleanup if pages_to_sg() fails Rob Clark
2026-10-27 23:04 ` [PATCH v3 2/6] drm/msm/gem: dma_map/unmap_sgtable() Rob Clark
2026-10-27 23:04 ` [PATCH v3 3/6] drm/msm: Extract out map/unmap helpers Rob Clark
2026-10-27 23:04 ` [PATCH v3 4/6] drm/msm: Convert iommu map/unmap to helpers Rob Clark
2026-10-27 23:04 ` [PATCH v3 5/6] drm/msm: Convert map helper to use dma-address Rob Clark
2026-10-28 1:14 ` Dmitry Baryshkov
2026-10-28 1:34 ` Rob Clark
2026-10-27 23:04 ` [PATCH v3 6/6] drm/msm: Treat !mapped as an error Rob Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027230452.130031-1-robin.clark@oss.qualcomm.com \
--to=robin.clark@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liujianfeng1994@gmail.com \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®