Re: [PATCH] drm/msm: restore GEM-related IOCTLs for KMS devices

From: Rob Clark

Date: Thu Mar 05 2026 - 10:16:49 EST


On Wed, Mar 4, 2026 at 5:03 PM Dmitry Baryshkov
<dmitry.baryshkov@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > On Wed, Mar 4, 2026 at 5:34 AM Dmitry Baryshkov
> > > <dmitry.baryshkov@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx>
> > > > ---
> > > > 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