summaryrefslogtreecommitdiff
path: root/D144284.diff
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2022-06-07 11:19:41 +0200
committerMartin Stransky <stransky@redhat.com>2022-06-07 11:19:41 +0200
commit61879d2c53a0473a24b4a9a69fcedd1af8f74fdf (patch)
treed12a4530b17d4c7e0cde6ecb74aa5e47e5120477 /D144284.diff
parentUpdated cbindgen to 0.23.0 (diff)
downloadlibrewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.tar.gz
librewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.tar.bz2
librewolf-fedora-ff-61879d2c53a0473a24b4a9a69fcedd1af8f74fdf.zip
Enabled VA-API by default (+ added VA-API fixes from upstream), Fixed WebGL performance on NVIDIA drivers (mzbz#1735929)
Diffstat (limited to 'D144284.diff')
-rw-r--r--D144284.diff77
1 files changed, 77 insertions, 0 deletions
diff --git a/D144284.diff b/D144284.diff
new file mode 100644
index 0000000..d838254
--- /dev/null
+++ b/D144284.diff
@@ -0,0 +1,77 @@
+diff --git a/gfx/layers/DMABUFSurfaceImage.cpp b/gfx/layers/DMABUFSurfaceImage.cpp
+--- a/gfx/layers/DMABUFSurfaceImage.cpp
++++ b/gfx/layers/DMABUFSurfaceImage.cpp
+@@ -39,20 +39,20 @@
+
+ StaticRefPtr<GLContext> sSnapshotContext;
+ static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED;
+
+ already_AddRefed<gfx::SourceSurface> DMABUFSurfaceImage::GetAsSourceSurface() {
++ StaticMutexAutoLock lock(sSnapshotContextMutex);
+ if (!sSnapshotContext) {
+ nsCString discardFailureId;
+ sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId);
+ if (!sSnapshotContext) {
+ gfxCriticalError() << "Failed to create snapshot GLContext.";
+ return nullptr;
+ }
+ }
+
+- StaticMutexAutoLock lock(sSnapshotContextMutex);
+ sSnapshotContext->MakeCurrent();
+
+ auto releaseTextures =
+ mozilla::MakeScopeExit([&] { mSurface->ReleaseTextures(); });
+
+diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
+--- a/widget/gtk/DMABufSurface.cpp
++++ b/widget/gtk/DMABufSurface.cpp
+@@ -53,24 +53,13 @@
+ using namespace mozilla::layers;
+
+ #define BUFFER_FLAGS 0
+
+ static RefPtr<GLContext> sSnapshotContext;
++static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED;
+ static Atomic<int> gNewSurfaceUID(1);
+
+-bool EnsureSnapshotGLContext() {
+- if (!sSnapshotContext) {
+- nsCString discardFailureId;
+- sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId);
+- if (!sSnapshotContext) {
+- NS_WARNING("Failed to create snapshot GLContext");
+- return false;
+- }
+- }
+- return true;
+-}
+-
+ bool DMABufSurface::IsGlobalRefSet() const {
+ if (!mGlobalRefCountFd) {
+ return false;
+ }
+ struct pollfd pfd;
+@@ -1263,13 +1252,18 @@
+ }
+
+ bool DMABufSurfaceYUV::VerifyTextureCreation() {
+ LOGDMABUF(("DMABufSurfaceYUV::VerifyTextureCreation() UID %d", mUID));
+
+- if (!EnsureSnapshotGLContext()) {
+- LOGDMABUF((" failed to create GL context!"));
+- return false;
++ StaticMutexAutoLock lock(sSnapshotContextMutex);
++ if (!sSnapshotContext) {
++ nsCString discardFailureId;
++ sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId);
++ if (!sSnapshotContext) {
++ NS_WARNING("Failed to create snapshot GLContext");
++ return false;
++ }
+ }
+
+ auto release = MakeScopeExit([&] { ReleaseEGLImages(sSnapshotContext); });
+
+ for (int i = 0; i < mBufferPlaneCount; i++) {
+
bgstack15