[PATCH 0/9] drm: Revert general use of struct drm_gem_object.dma_buf
Simona Vetter
simona.vetter at ffwll.ch
Fri Jul 11 11:26:36 UTC 2025
On Fri, Jul 11, 2025 at 12:32:02PM +0200, Christian König wrote:
> On 11.07.25 11:35, Thomas Zimmermann wrote:
> > Revert the use of drm_gem_object.dma_buf back to .import_attach->dmabuf
> > in the affected places. Also revert any fixes on top. Separates references
> > to imported and exported DMA bufs within a GEM object; as before.
> >
> > Using the dma_buf as the one authoritative field for the DMA buf turns
> > out to be fragile. The GEM object's dma_buf pointer can be NULL if
> > userspace releases the GEM handle too early. Sima mentioned that the fix
> > in commit 5307dce878d4 ("drm/gem: Acquire references on GEM handles for
> > framebuffers") is conceptionally broken. Linus still notices boot-up
> > hangs that might be related.
>
> Did I missed that response? What exactly is the issue?
Sorry, private thread from Linus that he's hit the regression, applied the
fix, which was apparently not enough. Then applied the revert of "drm/gem:
Acquire references on GEM handles for framebuffers", which worked better,
but still resulted in not-before-seen issues somehow. At that point I
figured it's best we backtrack because we seem to have a history of not
really understanding this anymore collectively. Thomas also found yet
another related regression around drm_prime in -next, so this looks way
too messy to me for late -rc.
The regressions left over after the bugfix from Thomas that's in
drm-misc-fixes is some silent hangs at login, without any traces anywhere
what got stuck.
We don't yet have feedback from Linus whether the revert more approach
here helps.
> > Reverting the whole thing is the only sensible action here.
>
> Feel free to add Acked-by: Christian König <christian.koenig at amd.com> to the entire series.
Thanks, I'll apply it to drm-fixes directly assuming intel-gfx-ci
approves.
Note that I'm not fundamentally opposed to the concepts here, at least the
usage count extensions of handle_count seems not entirely off. But it does
look very questionable to fix the patches that switched from
->import_attach.dmabuf to ->dma_buf, and it's simply too late in the -rc
for more big games.
Cheers, Sima
>
> Regards,
> Christian.
>
> >
> > Tested on virtio; and amdgpu, simpledrm plus udl for dma-buf sharing.
> >
> > Thomas Zimmermann (9):
> > Revert "drm/framebuffer: Acquire internal references on GEM handles"
> > Revert "drm/gem: Acquire references on GEM handles for framebuffers"
> > Revert "drm/virtio: Use dma_buf from GEM object instance"
> > Revert "drm/vmwgfx: Use dma_buf from GEM object instance"
> > Revert "drm/etnaviv: Use dma_buf from GEM object instance"
> > Revert "drm/prime: Use dma_buf from GEM object instance"
> > Revert "drm/gem-framebuffer: Use dma_buf from GEM object instance"
> > Revert "drm/gem-shmem: Use dma_buf from GEM object instance"
> > Revert "drm/gem-dma: Use dma_buf from GEM object instance"
> >
> > drivers/gpu/drm/drm_framebuffer.c | 31 +---------
> > drivers/gpu/drm/drm_gem.c | 64 +++-----------------
> > drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
> > drivers/gpu/drm/drm_gem_framebuffer_helper.c | 8 ++-
> > drivers/gpu/drm/drm_gem_shmem_helper.c | 4 +-
> > drivers/gpu/drm/drm_internal.h | 2 -
> > drivers/gpu/drm/drm_prime.c | 8 ++-
> > drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 4 +-
> > drivers/gpu/drm/virtio/virtgpu_prime.c | 5 +-
> > drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 6 +-
> > include/drm/drm_framebuffer.h | 7 ---
> > 11 files changed, 35 insertions(+), 106 deletions(-)
> >
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the etnaviv
mailing list