egl/wayland: use surface dma-buf feedback to allocate surface buffers
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>
Mon, 26 Jul 2021 20:53:24 +0000 (17:53 -0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 26 Nov 2021 16:06:09 +0000 (16:06 +0000)
commitb5848b2dac1464f5364dc2a76bd11cac0cb5769b
treebca1b56cb03a3bcce577b0ae6ad4fc766a43bf71
parent5b56fc748a76149fa100e96bc3c267a3ccf70add
egl/wayland: use surface dma-buf feedback to allocate surface buffers

As explained in "egl/wayland: add initial dma-buf feedback support", we
still don't use the per-surface dma-buf feedback. In this patch we start
to use it.

If per-surface dma-buf feedback is advertised, use it to allocate
surface buffers. Also, the dma-buf protocol states that the feedback is
resent only when the client is using a suboptimal format/modifier pair.
So listen for new per-surface feedback events and reallocate the surface
buffers based on them. We can't change the format of a buffer, but we
can pick a new modifier.

This patch is based on previous work of Scott Anderson (@ascent).

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11248>
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_wayland.c