Re: [report] DMA-API: platform vgem: mapping sg segment longer than device claims to support [len=1048576] [max=65536]

From: Zenghui Yu
Date: Thu Jun 19 2025 - 12:07:32 EST


Hi Thomas,

On 2025/6/19 00:25, Thomas Zimmermann wrote:
> Hi
>
> Am 18.06.25 um 18:03 schrieb Zenghui Yu:
> > Hi all,
> >
> > Running the dmabuf-heap test [*] on mainline kernel triggers the
> > following splat:
> >
> >  ------------[ cut here ]------------
> >  DMA-API: platform vgem: mapping sg segment longer than device claims to support [len=1048576] [max=65536]
>
> Thanks for the bug report. We have a possible fix in the latest drm-
> misc-next tree. Does it work if use replace DRM_GEM_SHMEM_DRIVER_OPS
> with DRM_GEM_SHMEM_DRIVER_OPS_NO_MAP_SGT at [1]?
>
> [1] https://elixir.bootlin.com/linux/v6.16-rc2/source/drivers/gpu/drm/vgem/vgem_drv.c#L118

Thanks for the heads up! So I applied commit 660cd44659a0
("drm/shmem-helper: Import dmabuf without mapping its sg_table") [*] in
my local tree, together with your suggestion:

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c
b/drivers/gpu/drm/vgem/vgem_drv.c
index 2752ab4f1c97..ba0d4e611bd2 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -115,7 +115,7 @@ static const struct drm_driver vgem_driver = {
.num_ioctls = ARRAY_SIZE(vgem_ioctls),
.fops = &vgem_driver_fops,

- DRM_GEM_SHMEM_DRIVER_OPS,
+ DRM_GEM_SHMEM_DRIVER_OPS_NO_MAP_SGT,
.gem_create_object = vgem_gem_create_object,

.name = DRIVER_NAME,

The warning message disappeared with that. Thanks again!

[*]
https://gitlab.freedesktop.org/drm/kernel/-/commit/660cd44659a05c5fbfce6d2bb1ce448aa0f35594

Zenghui