summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Stransky <stransky@redhat.com>2020-09-15 19:27:27 +0200
committerMartin Stransky <stransky@redhat.com>2020-09-15 19:27:27 +0200
commit096b8b8fb53d27ff44305897a4e307cb795c7a42 (patch)
tree210f133701b69bf9451db2812e10775f24688246
parentUpdate to 81.0 (diff)
downloadlibrewolf-fedora-ff-096b8b8fb53d27ff44305897a4e307cb795c7a42.tar.gz
librewolf-fedora-ff-096b8b8fb53d27ff44305897a4e307cb795c7a42.tar.bz2
librewolf-fedora-ff-096b8b8fb53d27ff44305897a4e307cb795c7a42.zip
Added WebGL dmabuf fixes
-rw-r--r--firefox-redhat-default-prefs.js4
-rw-r--r--firefox.spec4
-rw-r--r--mozilla-1656505-1.patch15
-rw-r--r--mozilla-1656505-2.patch113
4 files changed, 133 insertions, 3 deletions
diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js
index 461abb0..ff9bfce 100644
--- a/firefox-redhat-default-prefs.js
+++ b/firefox-redhat-default-prefs.js
@@ -34,6 +34,4 @@ pref("spellchecker.dictionary_path","/usr/share/myspell");
pref("network.trr.mode", 5);
/* Enable per-user policy dir, see mozbz#1583466 */
pref("browser.policies.perUserDir", true);
-pref("browser.gnome-search-provider.enabled",true);
-/* We're not ready yet */
-pref("widget.dmabuf-webgl.enabled", false); \ No newline at end of file
+pref("browser.gnome-search-provider.enabled",true); \ No newline at end of file
diff --git a/firefox.spec b/firefox.spec
index 6e05abb..40383dc 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -179,6 +179,8 @@ Patch227: firefox-locale-debug.patch
# Upstream patches
Patch402: mozilla-1196777.patch
+Patch403: mozilla-1656505-1.patch
+Patch404: mozilla-1656505-2.patch
# Wayland specific upstream patches
Patch574: firefox-pipewire-0-2.patch
@@ -380,6 +382,8 @@ This package contains results of tests executed during build.
%patch227 -p1 -b .locale-debug
%patch402 -p1 -b .1196777
+%patch403 -p1 -b .1656505-1
+%patch404 -p1 -b .1656505-2
# Wayland specific upstream patches
%if 0%{?fedora} < 32
diff --git a/mozilla-1656505-1.patch b/mozilla-1656505-1.patch
new file mode 100644
index 0000000..23ec35c
--- /dev/null
+++ b/mozilla-1656505-1.patch
@@ -0,0 +1,15 @@
+diff --git a/widget/gtk/DMABufLibWrapper.cpp b/widget/gtk/DMABufLibWrapper.cpp
+--- a/widget/gtk/DMABufLibWrapper.cpp
++++ b/widget/gtk/DMABufLibWrapper.cpp
+@@ -149,8 +149,8 @@
+ }
+
+ nsDMABufDevice::nsDMABufDevice()
+- : mXRGBFormat({true, false, GBM_FORMAT_ARGB8888, nullptr, 0}),
+- mARGBFormat({true, true, GBM_FORMAT_XRGB8888, nullptr, 0}),
++ : mXRGBFormat({true, false, GBM_FORMAT_XRGB8888, nullptr, 0}),
++ mARGBFormat({true, true, GBM_FORMAT_ARGB8888, nullptr, 0}),
+ mGbmDevice(nullptr),
+ mGbmFd(-1),
+ mGdmConfigured(false),
+
diff --git a/mozilla-1656505-2.patch b/mozilla-1656505-2.patch
new file mode 100644
index 0000000..48ee37b
--- /dev/null
+++ b/mozilla-1656505-2.patch
@@ -0,0 +1,113 @@
+diff -up firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp.1656505-2 firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp
+--- firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp.1656505-2 2020-09-15 03:48:28.000000000 +0200
++++ firefox-81.0/gfx/gl/SharedSurfaceDMABUF.cpp 2020-09-15 18:13:03.683458125 +0200
+@@ -63,6 +63,8 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
+ return dmabufFactory;
+ }
+
++ LOGDMABUF(
++ ("SurfaceFactory_DMABUF::Create() failed, fallback to SW buffers.\n"));
+ gfxPlatformGtk::GetPlatform()->DisableDMABufWebGL();
+ return nullptr;
+ }
+diff -up firefox-81.0/widget/gtk/DMABufSurface.cpp.1656505-2 firefox-81.0/widget/gtk/DMABufSurface.cpp
+--- firefox-81.0/widget/gtk/DMABufSurface.cpp.1656505-2 2020-09-15 03:48:38.000000000 +0200
++++ firefox-81.0/widget/gtk/DMABufSurface.cpp 2020-09-15 18:13:03.683458125 +0200
+@@ -26,6 +26,7 @@
+ #include "GLContextTypes.h" // for GLContext, etc
+ #include "GLContextEGL.h"
+ #include "GLContextProvider.h"
++#include "ScopedGLHelpers.h"
+
+ #include "mozilla/layers/LayersSurfaces.h"
+
+@@ -320,6 +321,9 @@ bool DMABufSurfaceRGBA::Create(int aWidt
+ mWidth = aWidth;
+ mHeight = aHeight;
+
++ LOGDMABUF(("DMABufSurfaceRGBA::Create() UID %d size %d x %d\n", mUID, mWidth,
++ mHeight));
++
+ mGmbFormat = GetDMABufDevice()->GetGbmFormat(mSurfaceFlags & DMABUF_ALPHA);
+ if (!mGmbFormat) {
+ // Requested DRM format is not supported.
+@@ -329,6 +333,7 @@ bool DMABufSurfaceRGBA::Create(int aWidt
+ bool useModifiers = (aDMABufSurfaceFlags & DMABUF_USE_MODIFIERS) &&
+ mGmbFormat->mModifiersCount > 0;
+ if (useModifiers) {
++ LOGDMABUF((" Creating with modifiers\n"));
+ mGbmBufferObject[0] = nsGbmLib::CreateWithModifiers(
+ GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight, mGmbFormat->mFormat,
+ mGmbFormat->mModifiers, mGmbFormat->mModifiersCount);
+@@ -360,6 +365,7 @@ bool DMABufSurfaceRGBA::Create(int aWidt
+ }
+
+ if (!mGbmBufferObject[0]) {
++ LOGDMABUF((" Failed to create GbmBufferObject\n"));
+ return false;
+ }
+
+@@ -429,6 +435,8 @@ void DMABufSurfaceRGBA::ImportSurfaceDes
+ if (desc.refCount().Length() > 0) {
+ GlobalRefCountImport(desc.refCount()[0].ClonePlatformHandle().release());
+ }
++
++ LOGDMABUF(("DMABufSurfaceRGBA::Import() UID %d\n", mUID));
+ }
+
+ bool DMABufSurfaceRGBA::Create(const SurfaceDescriptor& aDesc) {
+@@ -448,6 +456,8 @@ bool DMABufSurfaceRGBA::Serialize(
+ AutoTArray<ipc::FileDescriptor, 1> fenceFDs;
+ AutoTArray<ipc::FileDescriptor, 1> refCountFDs;
+
++ LOGDMABUF(("DMABufSurfaceRGBA::Serialize() UID %d\n", mUID));
++
+ width.AppendElement(mWidth);
+ height.AppendElement(mHeight);
+ format.AppendElement(mGmbFormat->mFormat);
+@@ -469,7 +479,6 @@ bool DMABufSurfaceRGBA::Serialize(
+ SurfaceDescriptorDMABuf(mSurfaceType, mBufferModifier, mGbmBufferFlags,
+ fds, width, height, format, strides, offsets,
+ GetYUVColorSpace(), fenceFDs, mUID, refCountFDs);
+-
+ return true;
+ }
+
+@@ -556,7 +565,7 @@ bool DMABufSurfaceRGBA::CreateTexture(GL
+
+ aGLContext->MakeCurrent();
+ aGLContext->fGenTextures(1, &mTexture);
+- aGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture);
++ const ScopedBindTexture savedTex(aGLContext, mTexture);
+ aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S,
+ LOCAL_GL_CLAMP_TO_EDGE);
+ aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T,
+@@ -567,6 +576,7 @@ bool DMABufSurfaceRGBA::CreateTexture(GL
+ LOCAL_GL_LINEAR);
+ aGLContext->fEGLImageTargetTexture2D(LOCAL_GL_TEXTURE_2D, mEGLImage);
+ mGL = aGLContext;
++
+ return true;
+ }
+
+@@ -611,6 +621,10 @@ void* DMABufSurface::MapInternal(uint32_
+ return nullptr;
+ }
+
++ LOGDMABUF(
++ ("DMABufSurfaceRGBA::MapInternal() UID %d size %d x %d -> %d x %d\n",
++ mUID, aX, aY, aWidth, aHeight));
++
+ mMappedRegionStride[aPlane] = 0;
+ mMappedRegionData[aPlane] = nullptr;
+ mMappedRegion[aPlane] = nsGbmLib::Map(
+@@ -988,7 +1002,7 @@ bool DMABufSurfaceYUV::CreateTexture(GLC
+
+ aGLContext->MakeCurrent();
+ aGLContext->fGenTextures(1, &mTexture[aPlane]);
+- aGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, mTexture[aPlane]);
++ const ScopedBindTexture savedTex(aGLContext, mTexture[aPlane]);
+ aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_S,
+ LOCAL_GL_CLAMP_TO_EDGE);
+ aGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T,
+
bgstack15