diff options
author | Mario Kleiner <[email protected]> | 2018-06-13 06:04:15 +0200 |
---|---|---|
committer | Adam Jackson <[email protected]> | 2019-01-29 20:03:20 +0000 |
commit | 820dfcea431e4f96f25e6b340edd9cd1e449158b (patch) | |
tree | 1964b1200cc3fb9b8e99305011187d175ae250ca /src/egl/drivers/dri2/egl_dri2.c | |
parent | a34b0d68bbf8571e4d858cf4e1176766a50364de (diff) |
egl/wayland-drm: Only announce formats via wl_drm which the driver supports.
Check if a pixel format is supported by the Wayland servers gpu driver
before exposing it to the client via wl_drm, so we avoid reporting formats
to the client which the server gpu can't handle.
Restrict this reporting to the new color depth 30 formats for now, as the
ARGB/XRGB8888 and RGB565 formats are probably supported by every gpu under
the sun.
Atm. this is mostly useful to allow proper PRIME renderoffload for depth
30 formats on the typical Intel iGPU + NVidia dGPU "NVidia Optimus" laptop
combo.
Tested on Intel, AMD, NVidia with single-gpu setup and on a Intel + NVidia
Optimus setup.
Signed-off-by: Mario Kleiner <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 892e32dd4e3..c98b9a5d18a 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2797,7 +2797,8 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, const struct wayland_drm_callbacks wl_drm_callbacks = { .authenticate = (int(*)(void *, uint32_t)) dri2_dpy->vtbl->authenticate, .reference_buffer = dri2_wl_reference_buffer, - .release_buffer = dri2_wl_release_buffer + .release_buffer = dri2_wl_release_buffer, + .is_format_supported = dri2_wl_is_format_supported }; int flags = 0; uint64_t cap; |