summaryrefslogtreecommitdiff
path: root/mozilla-1656505-2.patch
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 /mozilla-1656505-2.patch
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
Diffstat (limited to 'mozilla-1656505-2.patch')
-rw-r--r--mozilla-1656505-2.patch113
1 files changed, 113 insertions, 0 deletions
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