vulkan/wsi/wayland: fold wsi_wl_display_swrast and wsi_wl_display_dmabuf into parent
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>
Tue, 27 Jul 2021 21:35:35 +0000 (18:35 -0300)
committerSimon Ser <contact@emersion.fr>
Mon, 16 Aug 2021 08:22:39 +0000 (10:22 +0200)
commit7383827acc83f9a42684424c82bc7fd1a485b058
tree6da48b9a3e1fdc663ed4c2259d49b0064d730c6f
parent1c9299eaded4f5dc760c0094230a908de1672912
vulkan/wsi/wayland: fold wsi_wl_display_swrast and wsi_wl_display_dmabuf into parent

The two structs wsi_wl_display_swrast and wsi_wl_display_dmabuf have in
common the list of formats and the only difference between both is the
interface object.

As we know that only one of the arrays is populated (we never bind to
wl_shm and the dmabuf interface simultaneously), we can move the members
of these structs to wsi_wl_display and simplify the code.

This is based on previous work of Simon Ser <contact@emersion.fr>.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12117>
src/vulkan/wsi/wsi_common_wayland.c