[PATCH 0/3] drm: Allow PRIME 'self-import' for all drivers

Thomas Zimmermann tzimmermann at suse.de
Fri Jun 16 07:11:38 UTC 2023


Hi

Am 16.06.23 um 05:59 schrieb Zack Rusin:
> On Thu, 2023-06-15 at 11:31 +0200, Thomas Zimmermann wrote:
>> Set drm_gem_prime_handle_to_fd() and drm_gem_prime_fd_to_handle()
>> for all DRM drivers. Even drivers that do not support PRIME import
>> or export of dma-bufs can now import their own buffer objects. This
>> is required by some userspace, such as wlroots-based compositors, to
>> share buffers among processes.
>>
>> The only driver that does not use the drm_gem_prime_*() helpers is
>> vmwgfx. Once it has been converted, the callbacks in struct drm_driver
>> can be removed.
> 
> Hmm, I'm not sure that's ever going to be possible on vmwgfx. Or at least not until
> Xorg is used by anything. Some things in vmwgfx stack create "surfaces" which are
> not GEM's (they can be backed by a GEM object, but don't have to) and the prime
> implementation on vmwgfx has to be able to export and import those.

I see that's not easily fixable, if at all. I'd remove the TODO item and 
change the callback comments to say that they are reserved for vmwgfx.

> 
> In an ideal world I'd just delete the ioctl's that allow creating those "surfaces",
> but of course that's a no-no, so possibility of introducing vmwgfx2 with a
> saner/modern ioctl model has been floating around internally. Which at least would
> open a path to removing vmwgfx at some point in the future, but there's not much
> that can be done about vmwgfx having to be able to prime import/export GEM's and
> wonky non-GEM objects.

We have removed ioctls before, but over years so that userspace had time 
to update. Removing the ioctls would require a change to the driver 
version, I think.

You could explore the option of implementing GEM-based objects with the 
GEM helpers and the non-GEM objects with the current code. If done 
correctly, the old non-GEM support could be hidden behind a Kconfig option.

Anyway, I'll change the patchset to reflect the current state.

Best regards
Thomas

> 
> z
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230616/56003a4b/attachment.sig>


More information about the dri-devel mailing list