From f43e45c984382a7f02c4b9a8cf4c8c1019ad193b Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Mon, 17 Jul 2023 10:15:56 +0200 Subject: [PATCH] backends/drm: work around llvmpipe implicit sync not working implicit sync doesn't work properly with glFlush + KMS and llvmpipe doesn't support EGL_ANDROID_native_fence_sync either, so we need to wait for rendering to complete in a blocking fashion. --- src/backends/drm/drm_egl_layer_surface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backends/drm/drm_egl_layer_surface.cpp b/src/backends/drm/drm_egl_layer_surface.cpp index 97c3e97988..840ca6f8dc 100644 --- a/src/backends/drm/drm_egl_layer_surface.cpp +++ b/src/backends/drm/drm_egl_layer_surface.cpp @@ -143,6 +143,10 @@ bool EglGbmLayerSurface::endRendering(const QRegion &damagedRegion) m_surface.gbmSwapchain->release(m_surface.currentSlot); m_surface.timeQuery->end(); glFlush(); + if (m_eglBackend->contextObject()->isSoftwareRenderer()) { + // llvmpipe doesn't do synchronization properly: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9375 + glFinish(); + } const auto buffer = importBuffer(m_surface, m_surface.currentSlot.get()); m_surface.renderEnd = std::chrono::steady_clock::now(); if (buffer) {