Re: [PATCH] drm: document expectations for GETFB2 handles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, February 15th, 2023 at 14:41, Pekka Paalanen <ppaalanen@xxxxxxxxx> wrote:

> I didn't know it was at all possible to have different GEM handles
> pointing to the same object. DMABUF import is guaranteed to return the
> existing GEM handle, right? Why is GETFB2 different? Why does it not
> have the same problem as what forced DMABUF import to return existing
> handles?

drm_gem_prime_fd_to_handle() explicitly checks whether the memory object
already has a GEM handle via drm_prime_lookup_buf_handle(). OTOH,
drm_mode_getfb() and drm_mode_getfb2_ioctl() just unconditionally call
drm_gem_handle_create().

Yes, it's a rather inconsistent detail. A detail which becomes very
important when ref'counting and trying not to leak GEM handles from
user-space. Fortunately GETFB/GETFB2 usage is pretty seldom.




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux