* [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices
@ 2026-03-04 13:34 Dmitry Baryshkov
2026-03-04 14:57 ` Rob Clark
2026-03-04 15:57 ` Rob Clark
0 siblings, 2 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2026-03-04 13:34 UTC (permalink / raw)
To: Rob Clark, Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang,
Sean Paul, Marijn Suijten, David Airlie, Simona Vetter
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel
The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the
KMS driver, imports them into the GPU driver (msm or kgsl) and then
uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take
the ioctls away from the KMS-only driver") dropped all IOCTLs from the
MSM KMS devices, pointing out the need to use dumb buffers, however dumb
buffers should not be used by the GPU for rendering. Restore GEM-related
IOCTLs for the KMS devices.
Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Note, here I assume that dumb buffers generally should not be used for
rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM
devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources.
---
drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index ed2a61c66ac9..f82c9a36a166 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = {
DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW),
};
+static const struct drm_ioctl_desc msm_kms_ioctls[] = {
+ DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW),
+};
+
static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file)
{
struct drm_device *dev = file->minor->dev;
@@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = {
#endif
MSM_FBDEV_DRIVER_OPS,
.show_fdinfo = msm_show_fdinfo,
+ .ioctls = msm_kms_ioctls,
+ .num_ioctls = ARRAY_SIZE(msm_kms_ioctls),
.fops = &fops,
.name = "msm-kms",
.desc = "MSM Snapdragon DRM",
---
base-commit: ac47870fd795549f03d57e0879fc730c79119f4b
change-id: 20260304-msm-restore-ioctls-2a1792311a09
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-04 13:34 [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices Dmitry Baryshkov @ 2026-03-04 14:57 ` Rob Clark 2026-03-04 14:59 ` Rob Clark 2026-03-04 15:57 ` Rob Clark 1 sibling, 1 reply; 8+ messages in thread From: Rob Clark @ 2026-03-04 14:57 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote: > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > KMS driver, imports them into the GPU driver (msm or kgsl) and then > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > buffers should not be used by the GPU for rendering. Restore GEM-related > IOCTLs for the KMS devices. > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > --- > Note, here I assume that dumb buffers generally should not be used for > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. That is problematic in kmsro.. (but also unsure to what degree kmsro ever got used "in production".. the x86 drivers don't use it. Android and chromeos didn't use it. Etc.) BR, -R > --- > drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > index ed2a61c66ac9..f82c9a36a166 100644 > --- a/drivers/gpu/drm/msm/msm_drv.c > +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = { > DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW), > }; > > +static const struct drm_ioctl_desc msm_kms_ioctls[] = { > + DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), > +}; > + > static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) > { > struct drm_device *dev = file->minor->dev; > @@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = { > #endif > MSM_FBDEV_DRIVER_OPS, > .show_fdinfo = msm_show_fdinfo, > + .ioctls = msm_kms_ioctls, > + .num_ioctls = ARRAY_SIZE(msm_kms_ioctls), > .fops = &fops, > .name = "msm-kms", > .desc = "MSM Snapdragon DRM", > > --- > base-commit: ac47870fd795549f03d57e0879fc730c79119f4b > change-id: 20260304-msm-restore-ioctls-2a1792311a09 > > Best regards, > -- > With best wishes > Dmitry > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-04 14:57 ` Rob Clark @ 2026-03-04 14:59 ` Rob Clark 2026-03-05 1:03 ` Dmitry Baryshkov 0 siblings, 1 reply; 8+ messages in thread From: Rob Clark @ 2026-03-04 14:59 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 4, 2026 at 6:57 AM Rob Clark <rob.clark@oss.qualcomm.com> wrote: > > On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov > <dmitry.baryshkov@oss.qualcomm.com> wrote: > > > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > > KMS driver, imports them into the GPU driver (msm or kgsl) and then > > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > > buffers should not be used by the GPU for rendering. Restore GEM-related > > IOCTLs for the KMS devices. > > > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > > --- > > Note, here I assume that dumb buffers generally should not be used for > > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. > > That is problematic in kmsro.. (but also unsure to what degree kmsro > ever got used "in production".. the x86 drivers don't use it. Android > and chromeos didn't use it. Etc.) (also, allocate from the gpu render node) BR, -R > BR, > -R > > > --- > > drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > > index ed2a61c66ac9..f82c9a36a166 100644 > > --- a/drivers/gpu/drm/msm/msm_drv.c > > +++ b/drivers/gpu/drm/msm/msm_drv.c > > @@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = { > > DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW), > > }; > > > > +static const struct drm_ioctl_desc msm_kms_ioctls[] = { > > + DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), > > +}; > > + > > static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) > > { > > struct drm_device *dev = file->minor->dev; > > @@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = { > > #endif > > MSM_FBDEV_DRIVER_OPS, > > .show_fdinfo = msm_show_fdinfo, > > + .ioctls = msm_kms_ioctls, > > + .num_ioctls = ARRAY_SIZE(msm_kms_ioctls), > > .fops = &fops, > > .name = "msm-kms", > > .desc = "MSM Snapdragon DRM", > > > > --- > > base-commit: ac47870fd795549f03d57e0879fc730c79119f4b > > change-id: 20260304-msm-restore-ioctls-2a1792311a09 > > > > Best regards, > > -- > > With best wishes > > Dmitry > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-04 14:59 ` Rob Clark @ 2026-03-05 1:03 ` Dmitry Baryshkov 2026-03-05 15:03 ` Rob Clark 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Baryshkov @ 2026-03-05 1:03 UTC (permalink / raw) To: Rob Clark Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 04, 2026 at 06:59:42AM -0800, Rob Clark wrote: > On Wed, Mar 4, 2026 at 6:57 AM Rob Clark <rob.clark@oss.qualcomm.com> wrote: > > > > On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov > > <dmitry.baryshkov@oss.qualcomm.com> wrote: > > > > > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > > > KMS driver, imports them into the GPU driver (msm or kgsl) and then > > > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > > > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > > > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > > > buffers should not be used by the GPU for rendering. Restore GEM-related > > > IOCTLs for the KMS devices. > > > > > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > > > --- > > > Note, here I assume that dumb buffers generally should not be used for > > > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > > > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. > > > > That is problematic in kmsro.. (but also unsure to what degree kmsro > > ever got used "in production".. the x86 drivers don't use it. Android > > and chromeos didn't use it. Etc.) > > (also, allocate from the gpu render node) I think Asahi and VC4 allocate buffers from the GPU node and then import them on the render side, but unfortunately iMX IPU driver doesn't seem to support PRIME_FD_TO_HANDLE. -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-05 1:03 ` Dmitry Baryshkov @ 2026-03-05 15:03 ` Rob Clark 0 siblings, 0 replies; 8+ messages in thread From: Rob Clark @ 2026-03-05 15:03 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 4, 2026 at 5:03 PM Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote: > > On Wed, Mar 04, 2026 at 06:59:42AM -0800, Rob Clark wrote: > > On Wed, Mar 4, 2026 at 6:57 AM Rob Clark <rob.clark@oss.qualcomm.com> wrote: > > > > > > On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov > > > <dmitry.baryshkov@oss.qualcomm.com> wrote: > > > > > > > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > > > > KMS driver, imports them into the GPU driver (msm or kgsl) and then > > > > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > > > > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > > > > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > > > > buffers should not be used by the GPU for rendering. Restore GEM-related > > > > IOCTLs for the KMS devices. > > > > > > > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > > > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > > > > --- > > > > Note, here I assume that dumb buffers generally should not be used for > > > > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > > > > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. > > > > > > That is problematic in kmsro.. (but also unsure to what degree kmsro > > > ever got used "in production".. the x86 drivers don't use it. Android > > > and chromeos didn't use it. Etc.) > > > > (also, allocate from the gpu render node) > > I think Asahi and VC4 allocate buffers from the GPU node and then import > them on the render side, but unfortunately iMX IPU driver doesn't seem > to support PRIME_FD_TO_HANDLE. I guess my general suggestion would be to allocate from GPU and import to display first, and if that fails then try the other way around if that fails. For kmsro we could handle this by providing our own ro->create_for_resource(). BR, -R ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-04 13:34 [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices Dmitry Baryshkov 2026-03-04 14:57 ` Rob Clark @ 2026-03-04 15:57 ` Rob Clark 2026-03-05 0:44 ` Dmitry Baryshkov 1 sibling, 1 reply; 8+ messages in thread From: Rob Clark @ 2026-03-04 15:57 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote: > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > KMS driver, imports them into the GPU driver (msm or kgsl) and then > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > buffers should not be used by the GPU for rendering. Restore GEM-related > IOCTLs for the KMS devices. We shouldn't be exposing DRIVER_RENDER on KMS-only nodes. If msm gbm is allocating from a primary node, that is problematic, since there is no guarantee that anything but the compositor has access to the primary node. BR, -R > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > --- > Note, here I assume that dumb buffers generally should not be used for > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. > --- > drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > index ed2a61c66ac9..f82c9a36a166 100644 > --- a/drivers/gpu/drm/msm/msm_drv.c > +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = { > DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW), > }; > > +static const struct drm_ioctl_desc msm_kms_ioctls[] = { > + DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), > + DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), > +}; > + > static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) > { > struct drm_device *dev = file->minor->dev; > @@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = { > #endif > MSM_FBDEV_DRIVER_OPS, > .show_fdinfo = msm_show_fdinfo, > + .ioctls = msm_kms_ioctls, > + .num_ioctls = ARRAY_SIZE(msm_kms_ioctls), > .fops = &fops, > .name = "msm-kms", > .desc = "MSM Snapdragon DRM", > > --- > base-commit: ac47870fd795549f03d57e0879fc730c79119f4b > change-id: 20260304-msm-restore-ioctls-2a1792311a09 > > Best regards, > -- > With best wishes > Dmitry > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-04 15:57 ` Rob Clark @ 2026-03-05 0:44 ` Dmitry Baryshkov 2026-11-03 15:42 ` Mahadevan P 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Baryshkov @ 2026-03-05 0:44 UTC (permalink / raw) To: Rob Clark Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On Wed, Mar 04, 2026 at 07:57:34AM -0800, Rob Clark wrote: > On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov > <dmitry.baryshkov@oss.qualcomm.com> wrote: > > > > The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the > > KMS driver, imports them into the GPU driver (msm or kgsl) and then > > uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take > > the ioctls away from the KMS-only driver") dropped all IOCTLs from the > > MSM KMS devices, pointing out the need to use dumb buffers, however dumb > > buffers should not be used by the GPU for rendering. Restore GEM-related > > IOCTLs for the KMS devices. > > We shouldn't be exposing DRIVER_RENDER on KMS-only nodes. If msm gbm > is allocating from a primary node, that is problematic, since there is > no guarantee that anything but the compositor has access to the > primary node. We are not exposing DRIVER_RENDER for KMS-only nodes. I'll check with the correponding colleagues, what exactly is their use case, if the allocation is happening in the compositor or in the app. In the latter case, I agree, the buffers should be allocated from the GPU. > > BR, > -R > > > > > Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> > > --- > > Note, here I assume that dumb buffers generally should not be used for > > rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM > > devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. > > --- > > drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > > index ed2a61c66ac9..f82c9a36a166 100644 > > --- a/drivers/gpu/drm/msm/msm_drv.c > > +++ b/drivers/gpu/drm/msm/msm_drv.c > > @@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = { > > DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW), > > }; > > > > +static const struct drm_ioctl_desc msm_kms_ioctls[] = { > > + DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), > > + DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), > > +}; > > + > > static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) > > { > > struct drm_device *dev = file->minor->dev; > > @@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = { > > #endif > > MSM_FBDEV_DRIVER_OPS, > > .show_fdinfo = msm_show_fdinfo, > > + .ioctls = msm_kms_ioctls, > > + .num_ioctls = ARRAY_SIZE(msm_kms_ioctls), > > .fops = &fops, > > .name = "msm-kms", > > .desc = "MSM Snapdragon DRM", > > > > --- > > base-commit: ac47870fd795549f03d57e0879fc730c79119f4b > > change-id: 20260304-msm-restore-ioctls-2a1792311a09 > > > > Best regards, > > -- > > With best wishes > > Dmitry > > -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices 2026-03-05 0:44 ` Dmitry Baryshkov @ 2026-11-03 15:42 ` Mahadevan P 0 siblings, 0 replies; 8+ messages in thread From: Mahadevan P @ 2026-11-03 15:42 UTC (permalink / raw) To: Dmitry Baryshkov, Rob Clark Cc: Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten, David Airlie, Simona Vetter, linux-arm-msm, dri-devel, freedreno, linux-kernel On 3/5/2026 6:14 AM, Dmitry Baryshkov wrote: > On Wed, Mar 04, 2026 at 07:57:34AM -0800, Rob Clark wrote: >> On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov >> <dmitry.baryshkov@oss.qualcomm.com> wrote: >>> The MSM GBM backend uses MSM_GEM_NEW to allocate GEM buffers from the >>> KMS driver, imports them into the GPU driver (msm or kgsl) and then >>> uses them for rendering / blending. Commit 98f11fd1cf92 ("drm/msm: Take >>> the ioctls away from the KMS-only driver") dropped all IOCTLs from the >>> MSM KMS devices, pointing out the need to use dumb buffers, however dumb >>> buffers should not be used by the GPU for rendering. Restore GEM-related >>> IOCTLs for the KMS devices. >> We shouldn't be exposing DRIVER_RENDER on KMS-only nodes. If msm gbm >> is allocating from a primary node, that is problematic, since there is >> no guarantee that anything but the compositor has access to the >> primary node. > We are not exposing DRIVER_RENDER for KMS-only nodes. I'll check with > the correponding colleagues, what exactly is their use case, if the > allocation is happening in the compositor or in the app. In the latter > case, I agree, the buffers should be allocated from the GPU. Hi Rob, In combination of msm-kms with kgsl, wayland clients allocate their own dma-bufs (typically through EGL/GLES on KGSL) and pass the fd to Weston, which imports them. Weston is therefore not allocating client buffers. GBM is mainly used for Weston-owned allocations such as render targets, composition buffers, and scanout/framebuffers. It can also be used by applications that allocate through EGL (GBM-based path). One additional consideration is that KGSL is not a DRM driver and does not expose a DRM render node. Since |gbm_create_device()| operates on DRM devices and relies on DRM interfaces such as |drmGetVersion()|, a KGSL device cannot be used as a GBM device. As a result, the MSM DRM/KMS node remains the natural GBM allocation point in this configuration. Thus we need to add render support in msm-kms driver. Thanks, Mahadevan >> BR, >> -R >> >>> Fixes: 98f11fd1cf92 ("drm/msm: Take the ioctls away from the KMS-only driver") >>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> >>> --- >>> Note, here I assume that dumb buffers generally should not be used for >>> rendering. That doesn't seem to be complete truth as Mesa kmsro on MSM >>> devices uses DRM_IOCTL_MODE_CREATE_DUMB to create buffers for resources. >>> --- >>> drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c >>> index ed2a61c66ac9..f82c9a36a166 100644 >>> --- a/drivers/gpu/drm/msm/msm_drv.c >>> +++ b/drivers/gpu/drm/msm/msm_drv.c >>> @@ -799,6 +799,14 @@ static const struct drm_ioctl_desc msm_ioctls[] = { >>> DRM_IOCTL_DEF_DRV(MSM_VM_BIND, msm_ioctl_vm_bind, DRM_RENDER_ALLOW), >>> }; >>> >>> +static const struct drm_ioctl_desc msm_kms_ioctls[] = { >>> + DRM_IOCTL_DEF_DRV(MSM_GEM_NEW, msm_ioctl_gem_new, DRM_RENDER_ALLOW), >>> + DRM_IOCTL_DEF_DRV(MSM_GEM_INFO, msm_ioctl_gem_info, DRM_RENDER_ALLOW), >>> + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_PREP, msm_ioctl_gem_cpu_prep, DRM_RENDER_ALLOW), >>> + DRM_IOCTL_DEF_DRV(MSM_GEM_CPU_FINI, msm_ioctl_gem_cpu_fini, DRM_RENDER_ALLOW), >>> + DRM_IOCTL_DEF_DRV(MSM_GEM_MADVISE, msm_ioctl_gem_madvise, DRM_RENDER_ALLOW), >>> +}; >>> + >>> static void msm_show_fdinfo(struct drm_printer *p, struct drm_file *file) >>> { >>> struct drm_device *dev = file->minor->dev; >>> @@ -868,6 +876,8 @@ static const struct drm_driver msm_kms_driver = { >>> #endif >>> MSM_FBDEV_DRIVER_OPS, >>> .show_fdinfo = msm_show_fdinfo, >>> + .ioctls = msm_kms_ioctls, >>> + .num_ioctls = ARRAY_SIZE(msm_kms_ioctls), >>> .fops = &fops, >>> .name = "msm-kms", >>> .desc = "MSM Snapdragon DRM", >>> >>> --- >>> base-commit: ac47870fd795549f03d57e0879fc730c79119f4b >>> change-id: 20260304-msm-restore-ioctls-2a1792311a09 >>> >>> Best regards, >>> -- >>> With best wishes >>> Dmitry >>> ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-03 15:42 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-03-04 13:34 [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices Dmitry Baryshkov 2026-03-04 14:57 ` Rob Clark 2026-03-04 14:59 ` Rob Clark 2026-03-05 1:03 ` Dmitry Baryshkov 2026-03-05 15:03 ` Rob Clark 2026-03-04 15:57 ` Rob Clark 2026-03-05 0:44 ` Dmitry Baryshkov 2026-11-03 15:42 ` Mahadevan P
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®