128.0-2: Backport fixes for NVIDIA crashes 💬 by Jan Alexander Steffens (heftig) 2 years ago (log)
Fixes: https://gitlab.archlinux.org/archlinux/packaging/packages/firefox/-/issues/7
Fixes: https://gitlab.archlinux.org/archlinux/packaging/packages/firefox/-/issues/7
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: stransky <stransky@redhat.com>
Date: Wed, 10 Jul 2024 10:59:53 +0000
Subject: [PATCH] Bug 1898476 [Wayland] Lock Wayland surface before Swap
buffers in RenderCompositorEGL r=emilio
Depends on D214884
Differential Revision: https://phabricator.services.mozilla.com/D214885
---
gfx/webrender_bindings/RenderCompositorEGL.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp b/gfx/webrender_bindings/RenderCompositorEGL.cpp
index ccabfd375f37..ba10c40657d9 100644
--- a/gfx/webrender_bindings/RenderCompositorEGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp
@@ -154,6 +154,16 @@ RenderedFrameId RenderCompositorEGL::EndFrame(
}
gl()->SetDamage(bufferInvalid);
}
+
+#ifdef MOZ_WIDGET_GTK
+ // Rendering on Wayland has to be atomic (buffer attach + commit) and
+ // wayland surface is also used by main thread so lock it before
+ // we paint at SwapBuffers().
+ UniquePtr<MozContainerSurfaceLock> lock;
+ if (auto* gtkWidget = mWidget->AsGTK()) {
+ lock = gtkWidget->LockSurface();
+ }
+#endif
gl()->SwapBuffers();
return frameId;
}
|