diff options
author | Martin Stransky <stransky@redhat.com> | 2022-06-07 11:19:41 +0200 |
---|---|---|
committer | Martin Stransky <stransky@redhat.com> | 2022-06-07 11:19:41 +0200 |
commit | 61879d2c53a0473a24b4a9a69fcedd1af8f74fdf (patch) | |
tree | d12a4530b17d4c7e0cde6ecb74aa5e47e5120477 /D144284.diff | |
parent | Updated cbindgen to 0.23.0 (diff) | |
download | librewolf-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.diff | 77 |
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++) { + |