diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c index 3e6109f9664c..860c02cab6b6 100644 --- a/src/gallium/frontends/dri/loader_dri3_helper.c +++ b/src/gallium/frontends/dri/loader_dri3_helper.c @@ -46,6 +46,7 @@ #include "util/macros.h" #include "util/u_atomic.h" #include "util/u_queue.h" +#include "util/u_debug.h" #include "util/simple_mtx.h" #include "drm-uapi/drm_fourcc.h" #include "dri_screen.h" @@ -1821,11 +1822,12 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int fourcc, if (!ret) buffer->modifier = DRM_FORMAT_MOD_INVALID; - /* Android's dma-buf implementation may lack sync-file import/export even - * though DRI3 buffer sharing itself works. In that case Present needs an - * explicit render-completion fence. + /* Some Android/Xwayland combinations cannot consume the XSync wait fence + * reliably. Keep an escape hatch for those sessions while retaining the + * explicit bridge by default on other platforms. */ - dri3_present_sync_init(draw, buffer_fds[0]); + if (!debug_get_bool_option("MESA_DRI3_DISABLE_PRESENT_WAIT_FENCE", false)) + dri3_present_sync_init(draw, buffer_fds[0]); if (draw->dri_screen_render_gpu != draw->dri_screen_display_gpu && draw->dri_screen_display_gpu && linear_buffer_display_gpu) {