[PATCH] drm: document expectations for GETFB2 handles

Simon Ser contact at emersion.fr
Thu Feb 16 09:25:38 UTC 2023


On Thursday, February 16th, 2023 at 10:11, Pekka Paalanen <ppaalanen at gmail.com> wrote:

> Btw. does this also mean that if you use GETFB2 to get handle A, you
> export that as dmabuf and import in the same open device instance, you
> again get handle A?

I haven't tested it, but I believe that is correct.

> IOW, you should never ever export a dmabuf of what you got with
> GETFB2. If one did, one might import it oneself via GBM, breaking all
> reference counting. But you also cannot "just leak" the handle A,
> because if GBM happens to run on a different DRM device opened
> instance, GBM would get a different handle to own.
> 
> That's... err. How is a compositor supposed to do transition animation
> from an old FB to its own thing? I guess mmap + glTexImage2D equivalent
> to make a copy of the old FB so one can use it as a texture?

I think the compositor can export the handle as DMA-BUF, then close the
handle immediately. Then go about its business as usual.


More information about the dri-devel mailing list