From 4a5ac158f60a3698f064779a839af05d90b4cdd3 Mon Sep 17 00:00:00 2001 From: Tomek Bury Date: Tue, 3 Mar 2020 14:41:50 +0000 Subject: [PATCH] Improve Wayland protocol version selection. VK-GL-CTS issue: 2252 Requesting specifically version 3 of the protocol makes the wl_surface_damage_buffer() API unavailable to the client, even if the compositor supports it. This may effectively disable the EGL_EXT_swap_buffers_with_damage extension in the EGL implementation. The wl_compositor protocol version 4 was released in Wayland 1.10 in february 2016. It contains a new define: #define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4 and a new API: wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height); Requesting "at least version 3" is still backwards compatible with older compositors, but doesn't block the newer ones from providing version 4 with the wl_surface_damage_buffer() API. This API can be used by EGL to implement the EGL_EXT_swap_buffers_with_damage extension. Affects: dEQP-EGL.functional.swap_buffers_with_damage.* Change-Id: I621524328a90b2d629baad8c96d3a18e1eb2cf76 --- framework/platform/lnx/wayland/tcuLnxWayland.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/platform/lnx/wayland/tcuLnxWayland.cpp b/framework/platform/lnx/wayland/tcuLnxWayland.cpp index bea6835f8..f4808db28 100644 --- a/framework/platform/lnx/wayland/tcuLnxWayland.cpp +++ b/framework/platform/lnx/wayland/tcuLnxWayland.cpp @@ -57,7 +57,7 @@ void Display::handleGlobal (void* data, struct wl_registry* registry, uint32_t i DE_UNREF(version); if (!strcmp(interface, "wl_compositor")) - _this->m_compositor = static_cast(wl_registry_bind(registry, id, &wl_compositor_interface, 3)); + _this->m_compositor = static_cast(wl_registry_bind(registry, id, &wl_compositor_interface, version > 3 ? version : 3)); /* Todo: when the xdg_shell protocol has stablized, we should move wl_shell to xdg_shell. */ if (!strcmp(interface, "wl_shell")) _this->m_shell = static_cast(wl_registry_bind(registry, id, &wl_shell_interface, 1)); -- 2.34.1