mesa/src/egl/drivers/dri2
Christopher James Halse Rogers 98675d34c1 egl/wayland: Fix zwp_linux_dmabuf usage
There's no guarantee that the formats advertised by wl_drm and the formats
advertised by zwp_linux_dmabuf_v1 are the same.

get_back_bo() handles this by falling back from createImageWithModifiers() to
createImage() when there's a wl_drm format but no corresponding linux_dmabuf
format, but create_wl_buffer() unconditionally tries to create a linux_dmabuf
buffer unless DRIimage has DRM_FORMAT_MOD_INVALID.

Fix this by always checking if the DRIimage modifier has been advertised
by zwp_linux_dmabuf_v1, and falling back to wl_drm if not.

If DRM_FORMAT_MOD_INVALID has been advertised then we trust the client
has allocated something appropriate and treat any modifier as matching.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2220
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4294>
2020-04-29 11:29:40 +01:00
..
egl_dri2.c gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally 2020-04-02 14:22:58 +00:00
egl_dri2.h egl: Factor out dri2_add_pbuffer_configs_for_visuals {device,surfaceless}. 2020-02-26 06:53:50 +01:00
egl_dri2_fallbacks.h egl/android: Delete set_damage_region from egl dri vtbl 2019-08-13 14:39:38 +02:00
platform_android.c egl/android: enable/disable KHR_partial_update correctly 2020-03-23 16:22:24 -07:00
platform_device.c egl: Factor out dri2_add_pbuffer_configs_for_visuals {device,surfaceless}. 2020-02-26 06:53:50 +01:00
platform_drm.c egl/drm: reinstate (kms_)swrast support 2020-04-01 16:21:36 +01:00
platform_surfaceless.c egl: Factor out dri2_add_pbuffer_configs_for_visuals {device,surfaceless}. 2020-02-26 06:53:50 +01:00
platform_wayland.c egl/wayland: Fix zwp_linux_dmabuf usage 2020-04-29 11:29:40 +01:00
platform_x11.c egl: directly access static members instead of using _egl{Get,Set}ConfigKey() 2020-02-14 18:03:07 +00:00
platform_x11_dri3.c egl/android: Delete set_damage_region from egl dri vtbl 2019-08-13 14:39:38 +02:00
platform_x11_dri3.h egl/x11: Handle both depth 30 formats for eglCreateImage(). (v4) 2018-08-01 12:55:37 +01:00