dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Should multiple PRIME_FD_TO_HANDLE ioctls on the same fd require multiple GEM_CLOSE?
@ 2021-10-12 13:42 John Cox
  2021-10-12 17:33 ` Simon Ser
  0 siblings, 1 reply; 4+ messages in thread
From: John Cox @ 2021-10-12 13:42 UTC (permalink / raw)
  To: dri-devel

Hi

I've a question about expected behavior. I am using the "vc4" backend.

If I convert a dmabuf fd to a bo handle twice using
DRM_IOCTL_PRIME_FD_TO_HANDLE then I get the same bo handle both times -
fair enough.

If I then close it twice with DRM_IOCTL_GEM_CLOSE then the second time
fails.

Is this expected behavior?  I think I would have hoped that the
PRIME_FD_TO_HANDLE ops would have incremented a ref count on the object
and it would need to be CLOSED as many times as it was "opened"
otherwise one bit of code can accidentally close a bo handle that was in
use in another.

Many thanks

John Cox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-13 13:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-12 13:42 Should multiple PRIME_FD_TO_HANDLE ioctls on the same fd require multiple GEM_CLOSE? John Cox
2021-10-12 17:33 ` Simon Ser
2021-10-12 18:37   ` John Cox
2021-10-13 13:28     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox