On Tue, 23 Apr 2019 at 15:06, Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote: > > On Tue, Apr 23, 2019 at 12:55:07PM +0100, Emil Velikov wrote: > > On Tue, 23 Apr 2019 at 09:05, Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote: > > > > > > Hi, > > > > > > > > The DRI3 code extensively uses prime_handle_to_fd and > > > > > prime_fd_to_handle for self-import. > > > > > > The callbacks are not used for self-import. > > > > > Userspace converts from it's own handles to a dmabuf fd and vice-versa. > > I assumed that's called self-import, is it not? > > self-import is importing a dma-buf into the driver which created it. > > drm_gem_prime.c has a shortcut for that, it'll just increase the gem > reference count instead of going though a full-blown export/import. > > The prime_handle_to_fd and prime_fd_to_handle callbacks are only needed > for the non-self-import case, where the other driver needs/provides a > scatter list. > Looking at kernel.org and drm-misc-next (as of a couple of hours ago) there is no drm_gem_prime.c file. I would imagine you meant drm_prime.c. Even then, the callbacks "prime_handle_to_fd" and "prime_fd_to_handle" are used by the ioctls themselves [1] [2]. There is no fall-back when the callbacks are missing - we error out with ENOSYS. I assume that by "callbacks are only needed" you meant that we should fix the ioctls to use the callbacks only for the non-self-import case? If so, that should land first before pulling out the prime callbacks, right? HTH Emil [1] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_prime.c?id=9158e3c31163488364c76bf6948507e7640d511f#n870 [2] https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_prime.c?id=9158e3c31163488364c76bf6948507e7640d511f#n889 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel