diff options
author | Mario Kleiner <[email protected]> | 2018-06-13 06:04:14 +0200 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-01-29 20:03:20 +0000 |
commit | a34b0d68bbf8571e4d858cf4e1176766a50364de (patch) | |
tree | cdeefd429390c67c70d50da668e435a43d8b8edb /include | |
parent | a920979d4f30a48a23f8ff375ce05fa8a947dd96 (diff) |
egl/wayland: Allow client->server format conversion for PRIME offload. (v2)
Support PRIME render offload between a Wayland server gpu and a Wayland
client gpu with different channel ordering for their color formats,
e.g., between Intel drivers which currently only support ARGB2101010
and XRGB2101010 import/display and nouveau which only supports ABGR2101010
rendering and display on nv-50 and later.
In the wl_visuals table, we also store for each format an alternate
sibling format which stores colors at the same precision, but with
different channel ordering, e.g., ARGB2101010 <-> ABGR2101010.
If a given client-gpu renderable format is not supported by the server
for import, but the alternate format is supported by the server, expose
the client-gpu renderable format as a valid EGLConfig to the client. At
eglSwapBuffers time, during the blitImage() detiling blit from the client
backbuffer to the linear buffer, the client format is converted to the
server supported format. As we have to do a copy for PRIME anyway,
this channel swizzling conversion comes essentially for free.
Note that even if a server gpu in principle does support sampling
from the clients native format, this conversion will be a performance
advantage if it allows to convert to the servers preferred format
for direct scanout, as the Wayland compositor may then be able to
directly page-flip a fullscreen client wl_buffer onto the primary
plane, or onto a hardware overlay plane, avoiding an extra data copy
for desktop composition.
Tested so far under Weston with: nouveau single-gpu, Intel single-gpu,
AMD single-gpu, "Optimus" Intel server iGPU for display + NVidia
client dGPU for rendering.
v2: Implement minor review comments by Eric Engestrom: Add some
comment and assert, and some style fixes for clarity.
No functional change.
Signed-off-by: Mario Kleiner <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions