Skip to content

egl/android: only apply front rendering usage in shared buffer mode

Yiwei Zhang requested to merge zzyiwei/mesa:mutable-render-buffer-fix into main

When EGL_KHR_mutable_render_buffer extension is enabled, advertised configs unconditionally include EGL_MUTABLE_RENDER_BUFFER_BIT_KHR bit.

However, f61337b5 starts requesting front rendering usage bit when EGL_MUTABLE_RENDER_BUFFER_BIT_KHR is seen on the SurfaceType, which essentially forces linear usage on all winsys BOs for gallium dri and i965 drivers on Android when cros gralloc is in use.

This patch dynamically appends or strips the front rendering usage bit depends on whether EGL_RENDER_BUFFER is EGL_SINGLE_BUFFER or EGL_BACK_BUFFER. The next dequeuBuffer call will switch the buffer sharing mode while re-allocating winsys BOs given the updated gralloc usage bits if necessary.

Fixes: f61337b5 ("egl/android: check front rendering support for cros gralloc")

Signed-off-by: Yiwei Zhang zzyiwei@chromium.org

/cc @robclark @anholt @chadversary @olv @roman.stratiienko

Edited by Yiwei Zhang

Merge request reports