From: Chen-Yu Tsai <wenst@chromium.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Rob Herring <robh@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Chen-Yu Tsai <wenst@chromium.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, asahi@lists.linux.dev
Subject: [PATCH v2 1/4] drm/rcar-du: Use drm_gem_dma_get_sg_table() helper to get scatter gather table
Date: Tue, 17 Mar 2026 14:40:43 +0800 [thread overview]
Message-ID: <20260317064049.696795-2-wenst@chromium.org> (raw)
In-Reply-To: <20260317064049.696795-1-wenst@chromium.org>
The rcar-du driver is directly calling dma_get_sgtable() on a
drm_gem_dma_object. Not passing the dma_attrs field in may cause
problems when DMA_ATTR_NO_KERNEL_MAPPING is added to the GEM DMA
helpers gain support later.
Instead, use the drm_gem_dma_get_sg_table() helper to get the scatter
gather table.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
Changes since v1:
- new patch
Not sure if we should add a helper like drm_fb_dma_get_gem_addr(). This
seems to be the only driver that is using a scatter gather table to pass
DMA addresses.
---
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 94c22d2db197..6a62608ee3a9 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -291,10 +291,16 @@ int rcar_du_vsp_map_fb(struct rcar_du_vsp *vsp, struct drm_framebuffer *fb,
dst = sg_next(dst);
}
} else {
- ret = dma_get_sgtable(rcdu->dev, sgt, gem->vaddr,
- gem->dma_addr, gem->base.size);
- if (ret)
+ struct sg_table *ret_sgt;
+
+ ret_sgt = drm_gem_dma_get_sg_table(gem);
+ if (IS_ERR(ret_sgt)) {
+ ret = PTR_ERR(ret_sgt);
goto fail;
+ }
+
+ memcpy(sgt, ret_sgt, sizeof(*sgt));
+ kfree(ret_sgt);
}
ret = vsp1_du_map_sg(vsp->vsp, sgt);
--
2.53.0.851.ga537e3e6e9-goog
next prev parent reply other threads:[~2026-03-17 6:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 6:40 [PATCH v2 0/4] drm: Support DMA per allocation kernel mappings Chen-Yu Tsai
2026-03-17 6:40 ` Chen-Yu Tsai [this message]
2026-03-18 16:02 ` [PATCH v2 1/4] drm/rcar-du: Use drm_gem_dma_get_sg_table() helper to get scatter gather table Laurent Pinchart
2026-03-18 16:21 ` Chen-Yu Tsai
2026-03-18 16:27 ` Laurent Pinchart
2026-03-17 6:40 ` [PATCH v2 2/4] drm: Introduce DRM_MODE_DUMB_KERNEL_MAP flag Chen-Yu Tsai
2026-03-17 8:12 ` Thomas Zimmermann
2026-03-17 10:58 ` Chen-Yu Tsai
2026-03-17 12:24 ` Thomas Zimmermann
2026-03-18 4:57 ` Chen-Yu Tsai
2026-03-18 6:51 ` Chen-Yu Tsai
2026-03-17 6:40 ` [PATCH v2 3/4] drm/gem-dma: Use the dma_*_attr API variant Chen-Yu Tsai
2026-03-17 6:40 ` [PATCH v2 4/4] drm/gem-dma: Support DRM_MODE_DUMB_KERNEL_MAP flag Chen-Yu Tsai
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=20260317064049.696795-2-wenst@chromium.org \
--to=wenst@chromium.org \
--cc=airlied@gmail.com \
--cc=asahi@lists.linux.dev \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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®