Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (de549bf6468881524998992701042d09e6a7449a)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (de549bf6468881524998992701042d09e6a7449a)
  • Date: Wed, 17 Jul 2024 01:49:10 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

http/firefox/HISTORY
| 3
http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
| 128 +++
http/firefox/patches/0019-gcc-lto-pgo.patch
| 66 -
http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
| 368 ++++++++++

http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
| 16
5 files changed, 515 insertions(+), 66 deletions(-)

New commits:
commit de549bf6468881524998992701042d09e6a7449a
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

http/firefox: updated patches for 128.0

diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index 7a307c4..f589bac 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,6 @@
+2024-07-16 Pavel Vinogradov <public AT sourcemage.org>
+ * patches/*: updated
+
2024-07-10 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 128.0, SECURITY_PATCH++
* DEPENDS: nss >= 3.101
diff --git a/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
b/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
new file mode 100644
index 0000000..3d8a0b1
--- /dev/null
+++ b/http/firefox/patches/0019-gcc-lto-pgo-from-fedora.patch
@@ -0,0 +1,128 @@
+diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo
firefox-128.0/build/moz.configure/lto-pgo.configure
+--- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02
00:34:14.000000000 +0200
++++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02
17:59:44.425650444 +0200
+@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi
+
+ @depends(
+ "--enable-profile-use",
++ c_compiler,
+ pgo_profile_path,
+ llvm_profdata,
+ llvm_profdata_order,
+ build_environment,
+ )
+-def orderfile_path(profile_use, path, profdata, profdata_order, build_env):
++def orderfile_path(profile_use, compiler, path, profdata, profdata_order,
build_env):
++ if compiler.type == "gcc":
++ return None
++
+ if not profile_use:
+ return None
+
+@@ -133,7 +137,7 @@ def pgo_flags(
+ return namespace(
+ gen_cflags=["-fprofile-generate"],
+ gen_ldflags=["-fprofile-generate"],
+- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
++ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wno-coverage-mismatch"],
+ use_ldflags=["-fprofile-use"],
+ )
+
+diff -up firefox-128.0/build/pgo/profileserver.py.pgo
firefox-128.0/build/pgo/profileserver.py
+--- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02
00:34:15.000000000 +0200
++++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444
+0200
+@@ -11,7 +11,7 @@ import subprocess
+ import sys
+
+ import mozcrash
+-from mozbuild.base import BinaryNotFoundException, MozbuildObject
++from mozbuild.base import BinaryNotFoundException, MozbuildObject,
BuildEnvironmentNotFoundException
+ from mozfile import TemporaryDirectory
+ from mozhttpd import MozHttpd
+ from mozprofile import FirefoxProfile, Preferences
+@@ -97,9 +97,22 @@ if __name__ == "__main__":
+ locations = ServerLocations()
+ locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
+
+- old_profraw_files = glob.glob("*.profraw")
+- for f in old_profraw_files:
+- os.remove(f)
++ using_gcc = False
++ try:
++ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
++ using_gcc = True
++ except BuildEnvironmentNotFoundException:
++ pass
++
++ if using_gcc:
++ for dirpath, _, filenames in os.walk('.'):
++ for f in filenames:
++ if f.endswith('.gcda'):
++ os.remove(os.path.join(dirpath, f))
++ else:
++ old_profraw_files = glob.glob('*.profraw')
++ for f in old_profraw_files:
++ os.remove(f)
+
+ with TemporaryDirectory() as profilePath:
+ # TODO: refactor this into mozprofile
+diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build
+--- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200
++++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200
+@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]:
+ # The file uses SSE2 intrinsics, so it needs special compile flags on
some
+ # compilers.
+ SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"]
++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"]
+ SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
+ SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"]
+ elif CONFIG["TARGET_CPU"].startswith("mips"):
+diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo
firefox-128.0/gfx/skia/generate_mozbuild.py
+--- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02
17:59:44.425650444 +0200
++++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02
18:17:40.973081400 +0200
+@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/gfx/skia/moz.build.pgo
firefox-128.0/gfx/skia/moz.build
+--- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444
+0200
++++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200
+@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
+ if CONFIG['INTEL_ARCHITECTURE']:
+ SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX']
+ skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3']
+- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx']
+- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma']
++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto']
++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma',
'-fno-lto']
+ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags +=
skia_ssse3_flags
+ SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags +=
['-Dskvx=skvx_ssse3']
+diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
+--- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2024-07-02 00:34:32.000000000 +0200
++++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp
2024-07-02 17:59:44.425650444 +0200
+@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() {
+ }
+ #endif
+
++ // Disable watchdog for PGO train builds - writting profile information at
++ // exit may take time and it is better to make build hang rather than
++ // silently produce poorly performing binary.
++ crashAfterMS = INT32_MAX;
++
+ UniquePtr<Options> options(new Options());
+ // crashAfterTicks is guaranteed to be > 0 as
+ // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >>
HEARTBEAT_INTERVAL_MS
diff --git a/http/firefox/patches/0019-gcc-lto-pgo.patch
b/http/firefox/patches/0019-gcc-lto-pgo.patch
deleted file mode 100644
index d3bcbe5..0000000
--- a/http/firefox/patches/0019-gcc-lto-pgo.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-diff -up firefox-122.0/build/moz.configure/lto-pgo.configure.pgo
firefox-122.0/build/moz.configure/lto-pgo.configure
---- firefox-122.0/build/moz.configure/lto-pgo.configure.pgo 2024-01-18
21:41:19.000000000 +0100
-+++ firefox-122.0/build/moz.configure/lto-pgo.configure 2024-01-19
18:21:17.974681504 +0100
-@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target
- return namespace(
- gen_cflags=["-fprofile-generate"],
- gen_ldflags=["-fprofile-generate"],
-- use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wcoverage-mismatch"],
-+ use_cflags=["-fprofile-use", "-fprofile-correction",
"-Wno-coverage-mismatch"],
- use_ldflags=["-fprofile-use"],
- )
-
-diff -up firefox-122.0/build/pgo/profileserver.py.pgo
firefox-122.0/build/pgo/profileserver.py
---- firefox-122.0/build/pgo/profileserver.py.pgo 2024-01-18
21:41:20.000000000 +0100
-+++ firefox-122.0/build/pgo/profileserver.py 2024-01-19 18:21:17.974681504
+0100
-@@ -11,7 +11,7 @@ import subprocess
- import sys
-
- import mozcrash
--from mozbuild.base import BinaryNotFoundException, MozbuildObject
-+from mozbuild.base import BinaryNotFoundException, MozbuildObject,
BuildEnvironmentNotFoundException
- from mozfile import TemporaryDirectory
- from mozhttpd import MozHttpd
- from mozprofile import FirefoxProfile, Preferences
-@@ -98,9 +98,22 @@ if __name__ == "__main__":
- locations = ServerLocations()
- locations.add_host(host="127.0.0.1", port=PORT,
options="primary,privileged")
-
-- old_profraw_files = glob.glob("*.profraw")
-- for f in old_profraw_files:
-- os.remove(f)
-+ using_gcc = False
-+ try:
-+ if build.config_environment.substs.get('CC_TYPE') == 'gcc':
-+ using_gcc = True
-+ except BuildEnvironmentNotFoundException:
-+ pass
-+
-+ if using_gcc:
-+ for dirpath, _, filenames in os.walk('.'):
-+ for f in filenames:
-+ if f.endswith('.gcda'):
-+ os.remove(os.path.join(dirpath, f))
-+ else:
-+ old_profraw_files = glob.glob('*.profraw')
-+ for f in old_profraw_files:
-+ os.remove(f)
-
- with TemporaryDirectory() as profilePath:
- # TODO: refactor this into mozprofile
-diff -up firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo
firefox-122.0/toolkit/components/terminator/nsTerminator.cpp
---- firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo
2024-01-18 21:41:36.000000000 +0100
-+++ firefox-122.0/toolkit/components/terminator/nsTerminator.cpp
2024-01-19 18:21:17.976681572 +0100
-@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() {
- }
- #endif
-
-+ // Disable watchdog for PGO train builds - writting profile information at
-+ // exit may take time and it is better to make build hang rather than
-+ // silently produce poorly performing binary.
-+ crashAfterMS = INT32_MAX;
-+
- UniquePtr<Options> options(new Options());
- // crashAfterTicks is guaranteed to be > 0 as
- // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >>
HEARTBEAT_INTERVAL_MS
-
diff --git
a/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
b/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
new file mode 100644
index 0000000..8f8f9cb
--- /dev/null
+++ b/http/firefox/patches/0026-bmo-1898476-nvidia-wayland-egl-sync.patch
@@ -0,0 +1,368 @@
+diff --git a/widget/gtk/MozContainerSurfaceLock.cpp
b/widget/gtk/MozContainerSurfaceLock.cpp
+new file mode 100644
+--- /dev/null
++++ b/widget/gtk/MozContainerSurfaceLock.cpp
+@@ -0,0 +1,31 @@
++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2
-*- */
++/* This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#include "MozContainerSurfaceLock.h"
++#include "MozContainer.h"
++#include "WidgetUtilsGtk.h"
++
++using namespace mozilla::widget;
++
++MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) {
++#ifdef MOZ_WAYLAND
++ mContainer = aContainer;
++ if (GdkIsWaylandDisplay()) {
++ // mSurface can be nullptr if we lock hidden MozContainer and
++ // that's correct, MozContainer is still locked.
++ mSurface = moz_container_wayland_surface_lock(aContainer);
++ }
++#endif
++}
++
++MozContainerSurfaceLock::~MozContainerSurfaceLock() {
++#ifdef MOZ_WAYLAND
++ if (GdkIsWaylandDisplay()) {
++ moz_container_wayland_surface_unlock(mContainer, &mSurface);
++ }
++#endif
++}
++
++struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface;
}
+diff --git a/widget/gtk/MozContainerSurfaceLock.h
b/widget/gtk/MozContainerSurfaceLock.h
+new file mode 100644
+--- /dev/null
++++ b/widget/gtk/MozContainerSurfaceLock.h
+@@ -0,0 +1,28 @@
++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2
-*- */
++/* This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++#ifndef widget_gtk_MozContainerSurfaceLock_h
++#define widget_gtk_MozContainerSurfaceLock_h
++
++struct wl_surface;
++struct _MozContainer;
++typedef struct _MozContainer MozContainer;
++
++class MozContainerSurfaceLock {
++ public:
++ explicit MozContainerSurfaceLock(MozContainer* aContainer);
++ ~MozContainerSurfaceLock();
++
++ // wl_surface can be nullptr if we lock hidden MozContainer.
++ struct wl_surface* GetSurface();
++
++ private:
++#ifdef MOZ_WAYLAND
++ MozContainer* mContainer = nullptr;
++#endif
++ struct wl_surface* mSurface = nullptr;
++};
++
++#endif // widget_gtk_MozContainerSurfaceLock_h
+diff --git a/widget/gtk/MozContainerWayland.cpp
b/widget/gtk/MozContainerWayland.cpp
+--- a/widget/gtk/MozContainerWayland.cpp
++++ b/widget/gtk/MozContainerWayland.cpp
+@@ -82,33 +82,16 @@ using namespace mozilla;
+ using namespace mozilla::widget;
+
+ static bool moz_container_wayland_surface_create_locked(
+ const MutexAutoLock& aProofOfLock, MozContainer* container);
+ static void moz_container_wayland_set_opaque_region_locked(
+ const MutexAutoLock& aProofOfLock, MozContainer* container,
+ const LayoutDeviceIntRegion&);
+
+-// Lock mozcontainer and get wayland surface of it. You need to pair with
+-// moz_container_wayland_surface_unlock() even
+-// if moz_container_wayland_surface_lock() fails and returns nullptr.
+-static struct wl_surface* moz_container_wayland_surface_lock(
+- MozContainer* container);
+-static void moz_container_wayland_surface_unlock(MozContainer* container,
+- struct wl_surface**
surface);
+-
+-MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) {
+- mContainer = aContainer;
+- mSurface = moz_container_wayland_surface_lock(aContainer);
+-}
+-MozContainerSurfaceLock::~MozContainerSurfaceLock() {
+- moz_container_wayland_surface_unlock(mContainer, &mSurface);
+-}
+-struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface;
}
+-
+ // Invalidate gtk wl_surface to commit changes to wl_subsurface.
+ // wl_subsurface changes are effective when parent surface is commited.
+ static void moz_container_wayland_invalidate(MozContainer* container) {
+ LOGWAYLAND("moz_container_wayland_invalidate [%p]\n",
+ (void*)moz_container_get_nsWindow(container));
+
+ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container));
+ if (!window) {
+diff --git a/widget/gtk/MozContainerWayland.h
b/widget/gtk/MozContainerWayland.h
+--- a/widget/gtk/MozContainerWayland.h
++++ b/widget/gtk/MozContainerWayland.h
+@@ -8,16 +8,17 @@
+ #ifndef __MOZ_CONTAINER_WAYLAND_H__
+ #define __MOZ_CONTAINER_WAYLAND_H__
+
+ #include <gtk/gtk.h>
+ #include <functional>
+ #include <vector>
+ #include "mozilla/Mutex.h"
+ #include "WindowSurface.h"
++#include "MozContainerSurfaceLock.h"
+
+ /*
+ * MozContainer
+ *
+ * This class serves three purposes in the nsIWidget implementation.
+ *
+ * - It provides objects to receive signals from GTK for events on native
+ * windows.
+@@ -56,25 +57,22 @@ struct MozContainerWayland {
+ mozilla::Mutex container_lock{"MozContainerWayland::container_lock"};
+ };
+
+ struct _MozContainer;
+ struct _MozContainerClass;
+ typedef struct _MozContainer MozContainer;
+ typedef struct _MozContainerClass MozContainerClass;
+
+-class MozContainerSurfaceLock {
+- MozContainer* mContainer;
+- struct wl_surface* mSurface;
+-
+- public:
+- explicit MozContainerSurfaceLock(MozContainer* aContainer);
+- ~MozContainerSurfaceLock();
+- struct wl_surface* GetSurface();
+-};
++// Lock mozcontainer and get wayland surface of it. You need to pair with
++// moz_container_wayland_surface_unlock() even
++// if moz_container_wayland_surface_lock() fails and returns nullptr.
++struct wl_surface* moz_container_wayland_surface_lock(MozContainer*
container);
++void moz_container_wayland_surface_unlock(MozContainer* container,
++ struct wl_surface** surface);
+
+ void moz_container_wayland_map(GtkWidget*);
+ gboolean moz_container_wayland_map_event(GtkWidget*, GdkEventAny*);
+ void moz_container_wayland_size_allocate(GtkWidget*, GtkAllocation*);
+ void moz_container_wayland_unmap(GtkWidget*);
+
+ struct wl_egl_window* moz_container_wayland_get_egl_window(
+ MozContainer* container, double scale);
+diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
+--- a/widget/gtk/moz.build
++++ b/widget/gtk/moz.build
+@@ -28,16 +28,17 @@ if CONFIG["MOZ_WAYLAND"]:
+ if CONFIG["MOZ_ENABLE_VAAPI"]:
+ DIRS += ["vaapitest"]
+
+ if CONFIG["MOZ_ENABLE_V4L2"]:
+ DIRS += ["v4l2test"]
+
+ EXPORTS += [
+ "MozContainer.h",
++ "MozContainerSurfaceLock.h",
+ "nsGTKToolkit.h",
+ "nsGtkUtils.h",
+ "nsImageToPixbuf.h",
+ ]
+
+ EXPORTS.mozilla += [
+ "GfxInfo.h",
+ "GfxInfoUtils.h",
+@@ -66,16 +67,17 @@ UNIFIED_SOURCES += [
+ "DMABufLibWrapper.cpp",
+ "DMABufSurface.cpp",
+ "GfxInfo.cpp",
+ "gtk3drawing.cpp",
+ "GtkCompositorWidget.cpp",
+ "IMContextWrapper.cpp",
+ "InProcessGtkCompositorWidget.cpp",
+ "MozContainer.cpp",
++ "MozContainerSurfaceLock.cpp",
+ "MPRISServiceHandler.cpp",
+ "NativeKeyBindings.cpp",
+ "NativeMenuGtk.cpp",
+ "NativeMenuSupport.cpp",
+ "nsApplicationChooser.cpp",
+ "nsAppShell.cpp",
+ "nsBidiKeyboard.cpp",
+ "nsClipboard.cpp",
+@@ -109,16 +111,17 @@ if CONFIG["MOZ_WAYLAND"]:
+ UNIFIED_SOURCES += [
+ "MozContainerWayland.cpp",
+ "nsClipboardWayland.cpp",
+ "nsWaylandDisplay.cpp",
+ "WaylandBuffer.cpp",
+ "WindowSurfaceWaylandMultiBuffer.cpp",
+ ]
+ EXPORTS.mozilla.widget += [
++ "MozContainerSurfaceLock.h",
+ "MozContainerWayland.h",
+ "nsWaylandDisplay.h",
+ "WaylandBuffer.h",
+ ]
+
+ if CONFIG["MOZ_X11"]:
+ UNIFIED_SOURCES += [
+ "nsClipboardX11.cpp",
+
+diff --git a/widget/gtk/GtkCompositorWidget.cpp
b/widget/gtk/GtkCompositorWidget.cpp
+--- a/widget/gtk/GtkCompositorWidget.cpp
++++ b/widget/gtk/GtkCompositorWidget.cpp
+@@ -206,10 +206,14 @@ void GtkCompositorWidget::SetRenderingSu
+ }
+
+ #ifdef MOZ_LOGGING
+ bool GtkCompositorWidget::IsPopup() {
+ return mWidget ? mWidget->IsPopup() : false;
+ }
+ #endif
+
++UniquePtr<MozContainerSurfaceLock> GtkCompositorWidget::LockSurface() {
++ return mWidget ? mWidget->LockSurface() : nullptr;
++}
++
+ } // namespace widget
+ } // namespace mozilla
+diff --git a/widget/gtk/GtkCompositorWidget.h
b/widget/gtk/GtkCompositorWidget.h
+--- a/widget/gtk/GtkCompositorWidget.h
++++ b/widget/gtk/GtkCompositorWidget.h
+@@ -5,16 +5,18 @@
+
+ #ifndef widget_gtk_GtkCompositorWidget_h
+ #define widget_gtk_GtkCompositorWidget_h
+
+ #include "GLDefs.h"
+ #include "mozilla/DataMutex.h"
+ #include "mozilla/widget/CompositorWidget.h"
+ #include "WindowSurfaceProvider.h"
++#include "mozilla/UniquePtr.h"
++#include "MozContainerSurfaceLock.h"
+
+ class nsIWidget;
+ class nsWindow;
+
+ namespace mozilla {
+
+ namespace layers {
+ class NativeLayerRootWayland;
+@@ -91,16 +93,18 @@ class GtkCompositorWidget : public Compo
+ RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() override;
+ #endif
+
+ // PlatformCompositorWidgetDelegate Overrides
+
+ void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize)
override;
+ GtkCompositorWidget* AsGtkCompositorWidget() override { return this; }
+
++ UniquePtr<MozContainerSurfaceLock> LockSurface();
++
+ private:
+ #if defined(MOZ_WAYLAND)
+ void ConfigureWaylandBackend();
+ #endif
+ #if defined(MOZ_X11)
+ void ConfigureX11Backend(Window aXWindow, bool aShaped);
+ #endif
+ #ifdef MOZ_LOGGING
+diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
+--- a/widget/gtk/nsWindow.cpp
++++ b/widget/gtk/nsWindow.cpp
+@@ -10271,8 +10271,15 @@ void nsWindow::SetDragSource(GdkDragCont
+ mSourceDragContext = aSourceDragContext;
+ if (IsPopup() &&
+ (widget::GdkIsWaylandDisplay() || widget::IsXWaylandProtocol())) {
+ if (auto* menuPopupFrame = GetMenuPopupFrame(GetFrame())) {
+ menuPopupFrame->SetIsDragSource(!!aSourceDragContext);
+ }
+ }
+ }
++
++UniquePtr<MozContainerSurfaceLock> nsWindow::LockSurface() {
++ if (mIsDestroyed) {
++ return nullptr;
++ }
++ return MakeUnique<MozContainerSurfaceLock>(mContainer);
++}
+diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
+--- a/widget/gtk/nsWindow.h
++++ b/widget/gtk/nsWindow.h
+@@ -8,16 +8,17 @@
+ #ifndef __nsWindow_h__
+ #define __nsWindow_h__
+
+ #include <gdk/gdk.h>
+ #include <gtk/gtk.h>
+
+ #include "CompositorWidget.h"
+ #include "MozContainer.h"
++#include "MozContainerSurfaceLock.h"
+ #include "VsyncSource.h"
+ #include "mozilla/EventForwards.h"
+ #include "mozilla/Maybe.h"
+ #include "mozilla/RefPtr.h"
+ #include "mozilla/TouchEvents.h"
+ #include "mozilla/UniquePtr.h"
+ #include "mozilla/RWLock.h"
+ #include "mozilla/widget/WindowSurface.h"
+@@ -416,16 +417,18 @@ class nsWindow final : public nsBaseWidg
+ static bool TitlebarUseShapeMask();
+ bool IsRemoteContent() { return HasRemoteContent(); }
+ void NativeMoveResizeWaylandPopupCallback(const GdkRectangle* aFinalSize,
+ bool aFlippedX, bool aFlippedY);
+ static bool IsToplevelWindowTransparent();
+
+ static nsWindow* GetFocusedWindow();
+
++ mozilla::UniquePtr<MozContainerSurfaceLock> LockSurface();
++
+ #ifdef MOZ_WAYLAND
+ // Use xdg-activation protocol to transfer focus from gFocusWindow to
aWindow.
+ static void TransferFocusToWaylandWindow(nsWindow* aWindow);
+ void FocusWaylandWindow(const char* aTokenID);
+
+ bool GetCSDDecorationOffset(int* aDx, int* aDy);
+ bool SetEGLNativeWindowSize(const LayoutDeviceIntSize& aEGLWindowSize);
+ void WaylandDragWorkaround(GdkEventButton* aEvent);
+
+diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp
b/gfx/webrender_bindings/RenderCompositorEGL.cpp
+--- a/gfx/webrender_bindings/RenderCompositorEGL.cpp
++++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp
+@@ -149,16 +149,26 @@ RenderedFrameId RenderCompositorEGL::End
+ const auto width = right - left;
+ const auto height = bottom - top;
+
+ bufferInvalid.OrWith(
+ gfx::IntRect(left, (GetBufferSize().height - bottom), width,
height));
+ }
+ 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;
+ }
+
+ void RenderCompositorEGL::Pause() { DestroyEGLSurface(); }
+
+ bool RenderCompositorEGL::Resume() {
+ if (kIsAndroid) {
+
+
diff --git
a/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch

b/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
new file mode 100644
index 0000000..7f4b987
--- /dev/null
+++
b/http/firefox/patches/0027-bgo-925101-force-software-rendering-during-pgo-build.patch
@@ -0,0 +1,16 @@
+
+bgo#925101 for some unknown reason some users are having issues with pgo
crashing. Forcing software
+rendering to be used while pgo'ing doesn't have an impact in performance, as
hwaccel isn't used
+during pgo even when it works. The issue could be caused by
wrongly/automatically
+configured/detected gpu access anyway. The issue seems related to mesa, but
hard to pinpoint.
+
+diff '--color=auto' -Naur a/testing/profiles/profileserver/user.js
b/testing/profiles/profileserver/user.js
+--- a/testing/profiles/profileserver/user.js 2024-07-11 10:37:53.889115118
+0300
++++ b/testing/profiles/profileserver/user.js 2024-07-11 10:40:23.086996283
+0300
+@@ -11,3 +11,6 @@
+ user_pref("extensions.webextensions.warnings-as-errors", false);
+ // Turn off update
+ user_pref("app.update.disabledForTesting", true);
++// bgo#925101 mesa issues with pgo, force software rendering during pgo
++user_pref("gfx.webrender.software", true);
++


  • [[SM-Commit] ] GIT changes to master grimoire by Pavel Vinogradov (de549bf6468881524998992701042d09e6a7449a), Pavel Vinogradov, 07/16/2024

Archive powered by MHonArc 2.6.24.

Top of Page