mesa/src/egl
Mario Kleiner a34b0d68bb 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 <mario.kleiner.de@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2019-01-29 20:03:20 +00:00
..
drivers egl/wayland: Allow client->server format conversion for PRIME offload. (v2) 2019-01-29 20:03:20 +00:00
generate mapi: move genCommon.py to src/mapi/new 2019-01-24 18:13:25 +00:00
main egl: Implement EGL API for MESA_query_driver 2019-01-24 14:37:47 +00:00
wayland autoconf: stop exporting internal wayland details 2018-08-07 17:23:17 +01:00
.gitignore
Android.mk egl: drop unused _EGL_BUILT_IN_DRIVER_DRI2 2018-08-23 14:47:59 +01:00
Makefile.am mapi: move genCommon.py to src/mapi/new 2019-01-24 18:13:25 +00:00
Makefile.sources egl: add base EGL_EXT_device_base implementation 2018-11-01 00:05:43 +00:00
SConscript
egl-entrypoint-check egl: use the LC_ALL hammer instead of LANG 2018-11-01 17:25:08 +00:00
egl-symbols-check egl: Use correct shared libraries suffix on macOS. 2018-10-11 11:30:00 -07:00
meson.build mapi: move genCommon.py to src/mapi/new 2019-01-24 18:13:25 +00:00