Skip to Content.
Sympa Menu

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

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
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (b616cc6b9c4bdd82b12b4508a40c146581dc9264)
  • Date: Tue, 26 Jul 2022 21:13:25 +0000

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

http/firefox/DEPENDS
| 4
http/firefox/DETAILS
| 4
http/firefox/HISTORY
| 5
http/firefox/patches/0024-Disable-FFVPX-with-VA-API.patch
| 91 ---

http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 36 +

http/firefox/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
| 36 -

http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
| 96 +++

http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 37 +

http/firefox/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
| 96 ---
http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
| 16

http/firefox/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
| 35 -
http/firefox/patches/0028-bgo-816975-fix-build-on-x86.patch
| 16
http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
| 22
http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox/patches/0029-bmo-1559213-fix-system-av1-libs.patch
| 22
http/firefox/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
| 13
http/firefox/patches/0031-bmo-1773259-cbindgen-root_clip_chain-fix.patch
| 16
http/firefox/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
| 64 --
http/firefox/patches/0032-p05-bmo-1776724-build-wayland-only-D150485.patch
| 115 ++++
http/firefox/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
| 125 ----
http/firefox/patches/0033-bmo-1754469-memory_mozalloc_throw.patch
| 69 ++
http/firefox/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
| 278 ----------
http/firefox/patches/0034-bmo-1769631-python-3.11-compatibility.patch
| 30 +
http/firefox/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
| 139 -----
http/firefox/patches/0036-bmo-1773968-webgl-memory-leak.patch
| 80 --
http/firefox/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
| 28 -
http/firefox/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
| 250 --------
http/firefox/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
| 34 -
http/firefox/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
| 154 -----
http/firefox/patches/0041-p01-bmo-1772719-build-wayland-only.patch
| 36 -

http/firefox/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
| 84 ---
http/firefox/patches/0043-p02-bmo-1772721-build-wayland-only.patch
| 25
http/firefox/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
| 207 -------
http/firefox/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
| 14
http/firefox/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
| 115 ----
http/firefox/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
| 69 --
http/firefox/patches/0048-bmo-1769631-python-3.11-compatibility.patch
| 208 -------
37 files changed, 443 insertions(+), 2239 deletions(-)

New commits:
commit b616cc6b9c4bdd82b12b4508a40c146581dc9264
Author: Pavel Vinogradov <public AT sourcemaage.org>
Commit: Pavel Vinogradov <public AT sourcemaage.org>

http/firefox: version 103.0, SECURITY_PATCH++

diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index c7ca62d..e7a14ee 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -10,7 +10,7 @@ depends icu "--with-system-icu"
&&
depends glib2 &&
depends gtk+3 "--enable-default-toolkit=cairo-gtk3" &&
if spell_ok at-spi2-core &&
- is_version_less "2.45.1" "$(installed_version at-spi2-core)"; then
+ is_version_less "2.45.0" "$(installed_version at-spi2-core)"; then
depends at-spi2-core
else
depends atk
@@ -40,7 +40,7 @@ depends libwebp "--with-system-webp"
&&

depends nspr "--with-system-nspr" &&

-local NSS_BRANCH="3.79" &&
+local NSS_BRANCH="3.80" &&
if spell_ok nss &&
is_version_less "$(installed_version nss)" "${NSS_BRANCH}"; then
depends -sub "${NSS_BRANCH}" nss "--with-system-nss"
diff --git a/http/firefox/DETAILS b/http/firefox/DETAILS
index da251e6..07241b8 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,6 +1,6 @@
SPELL=firefox
- VERSION=102.0.1
- SECURITY_PATCH=165
+ VERSION=103.0
+ SECURITY_PATCH=166
SOURCE="${SPELL}-${VERSION}.source.tar.xz"

SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}";
SOURCE2="${SOURCE}.asc"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index bfe3862..8647bf9 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2022-07-26 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 103.0, SECURITY_PATCH++
+ * DEPENDS: nss >= 3.80, tweaked at-spi2-core version condition
+ * patches/*: updated
+
2022-07-13 Pavel Vinogradov <public AT sourcemage.org>
* DEPENDS: only needs atk if old at-spi2-core

diff --git a/http/firefox/patches/0024-Disable-FFVPX-with-VA-API.patch
b/http/firefox/patches/0024-Disable-FFVPX-with-VA-API.patch
deleted file mode 100644
index 42d639f..0000000
--- a/http/firefox/patches/0024-Disable-FFVPX-with-VA-API.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 38068d0801ad85ba36673ab2ad6a53e0fd3ffdde Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 29 Apr 2021 18:22:48 +0200
-Subject: [PATCH 27/30] Disable FFVPX with VA-API
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/platforms/PDMFactory.cpp | 32 +++++++++++++++---------------
- 1 file changed, 16 insertions(+), 16 deletions(-)
-
-diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
-index 9b0342ce82..4e377082ae 100644
---- a/dom/media/platforms/PDMFactory.cpp
-+++ b/dom/media/platforms/PDMFactory.cpp
-@@ -486,12 +486,6 @@ void PDMFactory::CreateRddPDMs() {
- CreateAndStartupPDM<AppleDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled() &&
-- StaticPrefs::media_rdd_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- StaticPrefs::media_rdd_ffmpeg_enabled() &&
-@@ -499,6 +493,12 @@ void PDMFactory::CreateRddPDMs() {
- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
- FFmpegRuntimeLinker::LinkStatusCode());
- }
-+#endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled() &&
-+ StaticPrefs::media_rdd_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
- #endif
- CreateAndStartupPDM<AgnosticDecoderModule>();
- }
-@@ -535,11 +535,6 @@ void PDMFactory::CreateContentPDMs() {
- CreateAndStartupPDM<OmxDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-@@ -547,6 +542,11 @@ void PDMFactory::CreateContentPDMs() {
- FFmpegRuntimeLinker::LinkStatusCode());
- }
- #endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
-+#endif
- #ifdef MOZ_WIDGET_ANDROID
- if (StaticPrefs::media_android_media_codec_enabled()) {
- StartupPDM(AndroidDecoderModule::Create(),
-@@ -581,11 +581,6 @@ void PDMFactory::CreateDefaultPDMs() {
- CreateAndStartupPDM<OmxDecoderModule>();
- }
- #endif
--#ifdef MOZ_FFVPX
-- if (StaticPrefs::media_ffvpx_enabled()) {
-- CreateAndStartupPDM<FFVPXRuntimeLinker>();
-- }
--#endif
- #ifdef MOZ_FFMPEG
- if (StaticPrefs::media_ffmpeg_enabled() &&
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-@@ -593,6 +588,11 @@ void PDMFactory::CreateDefaultPDMs() {
- FFmpegRuntimeLinker::LinkStatusCode());
- }
- #endif
-+#ifdef MOZ_FFVPX
-+ if (StaticPrefs::media_ffvpx_enabled()) {
-+ CreateAndStartupPDM<FFVPXRuntimeLinker>();
-+ }
-+#endif
- #ifdef MOZ_WIDGET_ANDROID
- if (StaticPrefs::media_android_media_codec_enabled()) {
- StartupPDM(AndroidDecoderModule::Create(),
---
-2.34.1
-
diff --git
a/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
new file mode 100644
index 0000000..2c6a271
--- /dev/null
+++
b/http/firefox/patches/0024-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
@@ -0,0 +1,36 @@
+From 58b0385412c6d96eb745e2fc5902df347e629f6d Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Thu, 29 Apr 2021 18:48:06 +0200
+Subject: [PATCH 28/30] Enable FLAC on platforms without ffvpx via ffmpeg
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/flac/FlacDecoder.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/dom/media/flac/FlacDecoder.cpp b/dom/media/flac/FlacDecoder.cpp
+index 2f205c9aae..68847b0952 100644
+--- a/dom/media/flac/FlacDecoder.cpp
++++ b/dom/media/flac/FlacDecoder.cpp
+@@ -7,6 +7,7 @@
+ #include "FlacDecoder.h"
+ #include "MediaContainerType.h"
+ #include "mozilla/StaticPrefs_media.h"
++#include "PDMFactory.h"
+
+ namespace mozilla {
+
+@@ -14,6 +15,10 @@ namespace mozilla {
+ bool FlacDecoder::IsEnabled() {
+ #ifdef MOZ_FFVPX
+ return StaticPrefs::media_flac_enabled();
++#elif defined(MOZ_FFMPEG)
++ RefPtr<PDMFactory> platform = new PDMFactory();
++ return StaticPrefs::media_flac_enabled() &&
++ platform->SupportsMimeType("audio/flac"_ns);
+ #else
+ return false;
+ #endif
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch

b/http/firefox/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
deleted file mode 100644
index 2c6a271..0000000
---
a/http/firefox/patches/0025-Enable-FLAC-on-platforms-without-ffvpx-via-ffmpeg.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 58b0385412c6d96eb745e2fc5902df347e629f6d Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Thu, 29 Apr 2021 18:48:06 +0200
-Subject: [PATCH 28/30] Enable FLAC on platforms without ffvpx via ffmpeg
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/flac/FlacDecoder.cpp | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/dom/media/flac/FlacDecoder.cpp b/dom/media/flac/FlacDecoder.cpp
-index 2f205c9aae..68847b0952 100644
---- a/dom/media/flac/FlacDecoder.cpp
-+++ b/dom/media/flac/FlacDecoder.cpp
-@@ -7,6 +7,7 @@
- #include "FlacDecoder.h"
- #include "MediaContainerType.h"
- #include "mozilla/StaticPrefs_media.h"
-+#include "PDMFactory.h"
-
- namespace mozilla {
-
-@@ -14,6 +15,10 @@ namespace mozilla {
- bool FlacDecoder::IsEnabled() {
- #ifdef MOZ_FFVPX
- return StaticPrefs::media_flac_enabled();
-+#elif defined(MOZ_FFMPEG)
-+ RefPtr<PDMFactory> platform = new PDMFactory();
-+ return StaticPrefs::media_flac_enabled() &&
-+ platform->SupportsMimeType("audio/flac"_ns);
- #else
- return false;
- #endif
---
-2.34.1
-
diff --git
a/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
new file mode 100644
index 0000000..856361d
--- /dev/null
+++
b/http/firefox/patches/0025-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
@@ -0,0 +1,96 @@
+From 0b53fcfa8ee76ccc2d77abb947810f631efaecd9 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Fri, 11 Dec 2020 15:37:38 +0100
+Subject: [PATCH 29/30] bmo#1670333: OpenH264: Fix decoding if it starts on
non
+ IDR I-frame
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ dom/media/mp4/MP4Demuxer.cpp | 8 ++++++++
+ dom/media/platforms/PDMFactory.cpp | 15 ++++++++++-----
+ dom/media/platforms/PDMFactory.h | 2 ++
+ 3 files changed, 20 insertions(+), 5 deletions(-)
+
+diff --git a/dom/media/mp4/MP4Demuxer.cpp b/dom/media/mp4/MP4Demuxer.cpp
+index 59bba16577..0304e3e89f 100644
+--- a/dom/media/mp4/MP4Demuxer.cpp
++++ b/dom/media/mp4/MP4Demuxer.cpp
+@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { return
gMediaDemuxerLog; }
+ DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
+ __func__, ##__VA_ARGS__)
+
++extern bool gUseKeyframeFromContainer;
++
+ namespace mozilla {
+
+ DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
+@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData>
MP4TrackDemuxer::GetNextSample() {
+ [[fallthrough]];
+ case H264::FrameType::OTHER: {
+ bool keyframe = type == H264::FrameType::I_FRAME;
++ if (gUseKeyframeFromContainer) {
++ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
++ sample->mKeyframe = keyframe;
++ }
++ break;
++ }
+ if (sample->mKeyframe != keyframe) {
+ NS_WARNING(nsPrintfCString("Frame incorrectly marked as
%skeyframe "
+ "@ pts:%" PRId64 " dur:%" PRId64
+diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
+index 4e377082ae..e778eb9948 100644
+--- a/dom/media/platforms/PDMFactory.cpp
++++ b/dom/media/platforms/PDMFactory.cpp
+@@ -58,6 +58,8 @@
+
+ #include <functional>
+
++bool gUseKeyframeFromContainer = false;
++
+ namespace mozilla {
+
+ #define PDM_INIT_LOG(msg, ...) \
+@@ -536,10 +538,12 @@ void PDMFactory::CreateContentPDMs() {
+ }
+ #endif
+ #ifdef MOZ_FFMPEG
+- if (StaticPrefs::media_ffmpeg_enabled() &&
+- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
+- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
+- FFmpegRuntimeLinker::LinkStatusCode());
++ if (StaticPrefs::media_ffmpeg_enabled()) {
++ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
++ if (!mFFmpegUsed) {
++ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
++ FFmpegRuntimeLinker::LinkStatusCode());
++ }
+ }
+ #endif
+ #ifdef MOZ_FFVPX
+@@ -556,8 +560,9 @@ void PDMFactory::CreateContentPDMs() {
+
+ CreateAndStartupPDM<AgnosticDecoderModule>();
+
+- if (StaticPrefs::media_gmp_decoder_enabled() &&
++ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
+ !CreateAndStartupPDM<GMPDecoderModule>()) {
++ gUseKeyframeFromContainer = true;
+ mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
+ }
+ }
+diff --git a/dom/media/platforms/PDMFactory.h
b/dom/media/platforms/PDMFactory.h
+index 4fc81c0b37..72f3255b6f 100644
+--- a/dom/media/platforms/PDMFactory.h
++++ b/dom/media/platforms/PDMFactory.h
+@@ -122,6 +122,8 @@ class PDMFactory final {
+
+ DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
+
++ bool mFFmpegUsed = false;
++
+ friend class RemoteVideoDecoderParent;
+ static void EnsureInit();
+ };
+--
+2.34.1
+
diff --git
a/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
new file mode 100644
index 0000000..4cc43ea
--- /dev/null
+++
b/http/firefox/patches/0026-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
@@ -0,0 +1,37 @@
+diff -up firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h
+--- firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844
2022-06-08 23:06:36.000000000 +0200
++++ firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h 2022-06-09
17:17:04.775008085 +0200
+@@ -27,7 +27,7 @@ class GMPSharedMem {
+ // returned to the parent pool (which is not included). If more than
+ // this are needed, we presume the client has either crashed or hung
+ // (perhaps temporarily).
+- static const uint32_t kGMPBufLimit = 20;
++ static const uint32_t kGMPBufLimit = 40;
+
+ GMPSharedMem() {
+ for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);
+diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
+---
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
++++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
2022-06-09 20:31:25.120035588 +0200
+@@ -84,6 +84,9 @@ media::DecodeSupportSet GMPDecoderModule
+
+ media::DecodeSupportSet GMPDecoderModule::SupportsMimeType(
+ const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics)
const {
++ if (MP4Decoder::IsH264(aMimeType)) {
++ return media::DecodeSupport::SoftwareDecode;
++ }
+ return media::DecodeSupport::Unsupported;
+ }
+
+diff -up
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+---
firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
2022-06-08 16:10:21.000000000 +0200
++++ firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
2022-06-09 17:17:04.776008117 +0200
+@@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
+ RefPtr<GMPVideoDecoder> self = this;
+ if (v) {
+ mDecodedData.AppendElement(std::move(v));
++ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
++ mDecodedData = DecodedData();
+ } else {
+ mDecodedData.Clear();
+ mDecodePromise.RejectIfExists(
diff --git
a/http/firefox/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch

b/http/firefox/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
deleted file mode 100644
index 856361d..0000000
---
a/http/firefox/patches/0026-bmo-1670333-OpenH264-Fix-decoding-if-it-starts-on-no.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 0b53fcfa8ee76ccc2d77abb947810f631efaecd9 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi AT gentoo.org>
-Date: Fri, 11 Dec 2020 15:37:38 +0100
-Subject: [PATCH 29/30] bmo#1670333: OpenH264: Fix decoding if it starts on
non
- IDR I-frame
-
-Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
----
- dom/media/mp4/MP4Demuxer.cpp | 8 ++++++++
- dom/media/platforms/PDMFactory.cpp | 15 ++++++++++-----
- dom/media/platforms/PDMFactory.h | 2 ++
- 3 files changed, 20 insertions(+), 5 deletions(-)
-
-diff --git a/dom/media/mp4/MP4Demuxer.cpp b/dom/media/mp4/MP4Demuxer.cpp
-index 59bba16577..0304e3e89f 100644
---- a/dom/media/mp4/MP4Demuxer.cpp
-+++ b/dom/media/mp4/MP4Demuxer.cpp
-@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { return
gMediaDemuxerLog; }
- DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
- __func__, ##__VA_ARGS__)
-
-+extern bool gUseKeyframeFromContainer;
-+
- namespace mozilla {
-
- DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
-@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData>
MP4TrackDemuxer::GetNextSample() {
- [[fallthrough]];
- case H264::FrameType::OTHER: {
- bool keyframe = type == H264::FrameType::I_FRAME;
-+ if (gUseKeyframeFromContainer) {
-+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
-+ sample->mKeyframe = keyframe;
-+ }
-+ break;
-+ }
- if (sample->mKeyframe != keyframe) {
- NS_WARNING(nsPrintfCString("Frame incorrectly marked as
%skeyframe "
- "@ pts:%" PRId64 " dur:%" PRId64
-diff --git a/dom/media/platforms/PDMFactory.cpp
b/dom/media/platforms/PDMFactory.cpp
-index 4e377082ae..e778eb9948 100644
---- a/dom/media/platforms/PDMFactory.cpp
-+++ b/dom/media/platforms/PDMFactory.cpp
-@@ -58,6 +58,8 @@
-
- #include <functional>
-
-+bool gUseKeyframeFromContainer = false;
-+
- namespace mozilla {
-
- #define PDM_INIT_LOG(msg, ...) \
-@@ -536,10 +538,12 @@ void PDMFactory::CreateContentPDMs() {
- }
- #endif
- #ifdef MOZ_FFMPEG
-- if (StaticPrefs::media_ffmpeg_enabled() &&
-- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
-- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-- FFmpegRuntimeLinker::LinkStatusCode());
-+ if (StaticPrefs::media_ffmpeg_enabled()) {
-+ mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>();
-+ if (!mFFmpegUsed) {
-+ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
-+ FFmpegRuntimeLinker::LinkStatusCode());
-+ }
- }
- #endif
- #ifdef MOZ_FFVPX
-@@ -556,8 +560,9 @@ void PDMFactory::CreateContentPDMs() {
-
- CreateAndStartupPDM<AgnosticDecoderModule>();
-
-- if (StaticPrefs::media_gmp_decoder_enabled() &&
-+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
- !CreateAndStartupPDM<GMPDecoderModule>()) {
-+ gUseKeyframeFromContainer = true;
- mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
- }
- }
-diff --git a/dom/media/platforms/PDMFactory.h
b/dom/media/platforms/PDMFactory.h
-index 4fc81c0b37..72f3255b6f 100644
---- a/dom/media/platforms/PDMFactory.h
-+++ b/dom/media/platforms/PDMFactory.h
-@@ -122,6 +122,8 @@ class PDMFactory final {
-
- DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
-
-+ bool mFFmpegUsed = false;
-+
- friend class RemoteVideoDecoderParent;
- static void EnsureInit();
- };
---
-2.34.1
-
diff --git a/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
b/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
new file mode 100644
index 0000000..4b2289f
--- /dev/null
+++ b/http/firefox/patches/0027-bgo-816975-fix-build-on-x86.patch
@@ -0,0 +1,16 @@
+diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
+index 51d79f9c2ec59..fafd7d6fc1e0d 100644
+--- a/modules/fdlibm/src/math_private.h
++++ b/modules/fdlibm/src/math_private.h
+@@ -30,7 +30,11 @@
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
+
++#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
++typedef long double __double_t;
++#else
+ typedef double __double_t;
++#endif
+ typedef __double_t double_t;
+
+ /*
diff --git
a/http/firefox/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch

b/http/firefox/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
deleted file mode 100644
index d356425..0000000
---
a/http/firefox/patches/0027-bmo-1663844-OpenH264-Allow-using-OpenH264-GMP-decode.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -up firefox-101.0/dom/media/gmp/GMPSharedMemManager.h.1663844
firefox-101.0/dom/media/gmp/GMPSharedMemManager.h
---- firefox-101.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2022-05-27
01:16:53.000000000 +0200
-+++ firefox-101.0/dom/media/gmp/GMPSharedMemManager.h 2022-05-30
21:15:20.989993419 +0200
-@@ -27,7 +27,7 @@ class GMPSharedMem {
- // returned to the parent pool (which is not included). If more than
- // this are needed, we presume the client has either crashed or hung
- // (perhaps temporarily).
-- static const uint32_t kGMPBufLimit = 20;
-+ static const uint32_t kGMPBufLimit = 40;
-
- GMPSharedMem() {
- for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]);
-diff -up
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
----
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844
2022-05-30 21:15:20.989993419 +0200
-+++ firefox-101.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp
2022-05-30 21:24:16.615282035 +0200
-@@ -66,6 +66,7 @@ media::DecodeSupportSet GMPDecoderModule
-
- nsCString api = nsLiteralCString(CHROMIUM_CDM_API);
-
-+ // TODO: Do we enable it here?
- if (MP4Decoder::IsH264(aMimeType)) {
- isSupported = HaveGMPFor(api, {"h264"_ns, aGMP.value()});
- } else if (VPXDecoder::IsVP9(aMimeType)) {
-diff -up
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
----
firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844
2022-05-27 01:16:53.000000000 +0200
-+++ firefox-101.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
2022-05-30 21:15:20.989993419 +0200
-@@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4
- RefPtr<GMPVideoDecoder> self = this;
- if (v) {
- mDecodedData.AppendElement(std::move(v));
-+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__);
-+ mDecodedData = DecodedData();
- } else {
- mDecodedData.Clear();
- mDecodePromise.RejectIfExists(
diff --git a/http/firefox/patches/0028-bgo-816975-fix-build-on-x86.patch
b/http/firefox/patches/0028-bgo-816975-fix-build-on-x86.patch
deleted file mode 100644
index 4b2289f..0000000
--- a/http/firefox/patches/0028-bgo-816975-fix-build-on-x86.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/modules/fdlibm/src/math_private.h
b/modules/fdlibm/src/math_private.h
-index 51d79f9c2ec59..fafd7d6fc1e0d 100644
---- a/modules/fdlibm/src/math_private.h
-+++ b/modules/fdlibm/src/math_private.h
-@@ -30,7 +30,11 @@
- * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
- */
-
-+#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2)
-+typedef long double __double_t;
-+#else
- typedef double __double_t;
-+#endif
- typedef __double_t double_t;
-
- /*
diff --git a/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
new file mode 100644
index 0000000..2423cca
--- /dev/null
+++ b/http/firefox/patches/0028-bmo-1559213-fix-system-av1-libs.patch
@@ -0,0 +1,22 @@
+diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
+index 0069865..e806fc8 100644
+--- a/media/ffvpx/libavcodec/moz.build
++++ b/media/ffvpx/libavcodec/moz.build
+@@ -112,9 +112,15 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
+ 'vaapi_vp8.c',
+ 'vaapi_vp9.c',
+ ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
++ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
++ else:
++ USE_LIBS += [
++ 'dav1d',
++ 'media_libdav1d_asm',
++ ]
+ USE_LIBS += [
+- 'dav1d',
+- 'media_libdav1d_asm',
+ 'mozva'
+ ]
+
diff --git
a/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
new file mode 100644
index 0000000..864741e
--- /dev/null
+++ b/http/firefox/patches/0029-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
@@ -0,0 +1,13 @@
+diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
+--- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
++++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
+@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
+- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
++ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
++ GDK_FOCUS_CHANGE_MASK;
+
+ /* utility functions */
+ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git a/http/firefox/patches/0029-bmo-1559213-fix-system-av1-libs.patch
b/http/firefox/patches/0029-bmo-1559213-fix-system-av1-libs.patch
deleted file mode 100644
index 2423cca..0000000
--- a/http/firefox/patches/0029-bmo-1559213-fix-system-av1-libs.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/media/ffvpx/libavcodec/moz.build
b/media/ffvpx/libavcodec/moz.build
-index 0069865..e806fc8 100644
---- a/media/ffvpx/libavcodec/moz.build
-+++ b/media/ffvpx/libavcodec/moz.build
-@@ -112,9 +112,15 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
- 'vaapi_vp8.c',
- 'vaapi_vp9.c',
- ]
-+ if CONFIG["MOZ_SYSTEM_AV1"]:
-+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
-+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
-+ else:
-+ USE_LIBS += [
-+ 'dav1d',
-+ 'media_libdav1d_asm',
-+ ]
- USE_LIBS += [
-- 'dav1d',
-- 'media_libdav1d_asm',
- 'mozva'
- ]
-
diff --git
a/http/firefox/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
b/http/firefox/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
deleted file mode 100644
index 864741e..0000000
--- a/http/firefox/patches/0030-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777
firefox-100.0/widget/gtk/nsWindow.cpp
---- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02
11:29:06.763325015 +0200
-+++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334
+0200
-@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR
- GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK |
GDK_SCROLL_MASK |
-- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK;
-+ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK |
-+ GDK_FOCUS_CHANGE_MASK;
-
- /* utility functions */
- static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX,
diff --git
a/http/firefox/patches/0031-bmo-1773259-cbindgen-root_clip_chain-fix.patch
b/http/firefox/patches/0031-bmo-1773259-cbindgen-root_clip_chain-fix.patch
deleted file mode 100644
index a996d35..0000000
--- a/http/firefox/patches/0031-bmo-1773259-cbindgen-root_clip_chain-fix.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Remove an extra constant definition that is now being generated
by newer versions of cbindgen (0.24), and causing build failures because it
is defined in several places.
-Author: Olivier Tilloy <olivier.tilloy AT canonical.com>
-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1773259
-Forwarded: not-needed
-
---- a/gfx/webrender_bindings/webrender_ffi.h
-+++ b/gfx/webrender_bindings/webrender_ffi.h
-@@ -73,8 +73,6 @@ struct WrPipelineInfo;
- struct WrPipelineIdAndEpoch;
- using WrPipelineIdEpochs = nsTArray<WrPipelineIdAndEpoch>;
-
--const uint64_t ROOT_CLIP_CHAIN = ~0;
--
- } // namespace wr
- } // namespace mozilla
-
diff --git
a/http/firefox/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
b/http/firefox/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
deleted file mode 100644
index f0c57dd..0000000
--- a/http/firefox/patches/0032-p03-bmo-1752494-vaapi-fixes-D147874.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -up firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff
firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp
---- firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp.D147874.diff 2022-05-27
01:16:54.000000000 +0200
-+++ firefox-101.0/gfx/thebes/gfxPlatformGtk.cpp 2022-06-07
11:16:03.791419558 +0200
-@@ -233,13 +233,7 @@ void gfxPlatformGtk::InitDmabufConfig()
- void gfxPlatformGtk::InitVAAPIConfig() {
- FeatureState& feature = gfxConfig::GetFeature(Feature::VAAPI);
- #ifdef MOZ_WAYLAND
-- feature.DisableByDefault(FeatureStatus::Disabled,
-- "VAAPI is disabled by default",
-- "FEATURE_VAAPI_DISABLED"_ns);
--
-- if (StaticPrefs::media_ffmpeg_vaapi_enabled()) {
-- feature.UserForceEnable("Force enabled by pref");
-- }
-+ feature.EnableByDefault();
-
- nsCString failureId;
- int32_t status;
-@@ -253,6 +247,10 @@ void gfxPlatformGtk::InitVAAPIConfig() {
- failureId);
- }
-
-+ if (StaticPrefs::media_ffmpeg_vaapi_enabled()) {
-+ feature.UserForceEnable("Force enabled by pref");
-+ }
-+
- if (!gfxVars::UseEGL()) {
- feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL",
- "FEATURE_FAILURE_REQUIRES_EGL"_ns);
-diff -up firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff
firefox-101.0/widget/gtk/GfxInfo.cpp
---- firefox-101.0/widget/gtk/GfxInfo.cpp.D147874.diff 2022-05-27
01:17:06.000000000 +0200
-+++ firefox-101.0/widget/gtk/GfxInfo.cpp 2022-06-07 09:52:54.416701418
+0200
-@@ -843,6 +843,31 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- V(495, 44, 0, 0), "FEATURE_FAILURE_NO_GBM", "495.44.0");
-
- ////////////////////////////////////
-+ // FEATURE_VAAPI
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::All, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
-+ V(21, 0, 0, 0), "FEATURE_ROLLOUT_VAAPI_MESA", "Mesa 21.0.0.0");
-+
-+ // Disable on all NVIDIA hardware
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All,
-+ DeviceFamily::NvidiaAll, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_NVIDIA", "");
-+
-+ // Disable on all AMD devices not using Mesa.
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All,
DriverVendor::NonMesaAll,
-+ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_VAAPI,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_VAAPI_NO_LINUX_AMD", "");
-+
-+ ////////////////////////////////////
- // FEATURE_WEBRENDER_PARTIAL_PRESENT
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
diff --git
a/http/firefox/patches/0032-p05-bmo-1776724-build-wayland-only-D150485.patch
b/http/firefox/patches/0032-p05-bmo-1776724-build-wayland-only-D150485.patch
new file mode 100644
index 0000000..1c27926
--- /dev/null
+++
b/http/firefox/patches/0032-p05-bmo-1776724-build-wayland-only-D150485.patch
@@ -0,0 +1,115 @@
+diff --git a/gfx/gl/GLContextProviderEGL.cpp
b/gfx/gl/GLContextProviderEGL.cpp
+--- a/gfx/gl/GLContextProviderEGL.cpp
++++ b/gfx/gl/GLContextProviderEGL.cpp
+@@ -77,10 +77,11 @@
+ #if defined(MOZ_WIDGET_GTK)
+ # include "mozilla/widget/GtkCompositorWidget.h"
+ # if defined(MOZ_WAYLAND)
+ # include <gdk/gdkwayland.h>
+ # include <wayland-egl.h>
++# include "mozilla/WidgetUtilsGtk.h"
+ # include "mozilla/widget/nsWaylandDisplay.h"
+ # endif
+ #endif
+
+ struct wl_egl_window;
+diff --git a/gfx/gl/GLContextProviderLinux.cpp
b/gfx/gl/GLContextProviderLinux.cpp
+--- a/gfx/gl/GLContextProviderLinux.cpp
++++ b/gfx/gl/GLContextProviderLinux.cpp
+@@ -11,49 +11,59 @@
+ namespace mozilla::gl {
+
+ using namespace mozilla::gfx;
+ using namespace mozilla::widget;
+
++#ifdef MOZ_X11
+ static class GLContextProviderGLX sGLContextProviderGLX;
++#endif
+ static class GLContextProviderEGL sGLContextProviderEGL;
+
+ already_AddRefed<GLContext>
GLContextProviderLinux::CreateForCompositorWidget(
+ CompositorWidget* aCompositorWidget, bool aHardwareWebRender,
+ bool aForceAccelerated) {
+ if (gfxVars::UseEGL()) {
+ return sGLContextProviderEGL.CreateForCompositorWidget(
+ aCompositorWidget, aHardwareWebRender, aForceAccelerated);
++#ifdef MOZ_X11
+ } else {
+ return sGLContextProviderGLX.CreateForCompositorWidget(
+ aCompositorWidget, aHardwareWebRender, aForceAccelerated);
++#endif
+ }
+ }
+
+ /*static*/
+ already_AddRefed<GLContext> GLContextProviderLinux::CreateHeadless(
+ const GLContextCreateDesc& desc, nsACString* const out_failureId) {
+ if (gfxVars::UseEGL()) {
+ return sGLContextProviderEGL.CreateHeadless(desc, out_failureId);
++#ifdef MOZ_X11
+ } else {
+ return sGLContextProviderGLX.CreateHeadless(desc, out_failureId);
++#endif
+ }
+ }
+
+ /*static*/
+ GLContext* GLContextProviderLinux::GetGlobalContext() {
+ if (gfxVars::UseEGL()) {
+ return sGLContextProviderEGL.GetGlobalContext();
++#ifdef MOZ_X11
+ } else {
+ return sGLContextProviderGLX.GetGlobalContext();
++#endif
+ }
+ }
+
+ /*static*/
+ void GLContextProviderLinux::Shutdown() {
+ if (gfxVars::UseEGL()) {
+ sGLContextProviderEGL.Shutdown();
++#ifdef MOZ_X11
+ } else {
+ sGLContextProviderGLX.Shutdown();
++#endif
+ }
+ }
+
+ } // namespace mozilla::gl
+diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
+--- a/gfx/gl/moz.build
++++ b/gfx/gl/moz.build
+@@ -105,14 +105,15 @@
+
+ elif gl_provider == "Linux":
+ # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
+ # as it includes X11 headers which cause conflicts.
+ SOURCES += [
+- "GLContextProviderGLX.cpp",
+ "GLContextProviderLinux.cpp",
+ ]
+ EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
++ if CONFIG["MOZ_X11"]:
++ SOURCES += ["GLContextProviderGLX.cpp"]
+
+ if CONFIG["MOZ_WAYLAND"]:
+ SOURCES += ["SharedSurfaceDMABUF.cpp"]
+
+ UNIFIED_SOURCES += [
+diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
+--- a/gfx/thebes/gfxPlatformGtk.cpp
++++ b/gfx/thebes/gfxPlatformGtk.cpp
+@@ -991,11 +991,11 @@
+ }
+
+ RefPtr<VsyncSource> softwareVsync = new XrandrSoftwareVsyncSource();
+ return softwareVsync.forget();
+ #else
+- return CreateSoftwareVsyncSource();
++ return GetSoftwareVsyncSource();
+ #endif
+ }
+
+ void gfxPlatformGtk::BuildContentDeviceData(ContentDeviceData* aOut) {
+ gfxPlatform::BuildContentDeviceData(aOut);
+
diff --git
a/http/firefox/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
b/http/firefox/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
deleted file mode 100644
index 1d4bb58..0000000
--- a/http/firefox/patches/0033-bmo-1735929-webgl-nvidia-p1-D147635.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-diff --git a/gfx/gl/GLLibraryEGL.h b/gfx/gl/GLLibraryEGL.h
---- a/gfx/gl/GLLibraryEGL.h
-+++ b/gfx/gl/GLLibraryEGL.h
-@@ -106,10 +106,13 @@
- KHR_swap_buffers_with_damage,
- EXT_buffer_age,
- KHR_partial_update,
- NV_robustness_video_memory_purge,
- MESA_platform_surfaceless,
-+ EXT_image_dma_buf_import,
-+ EXT_image_dma_buf_import_modifiers,
-+ MESA_image_dma_buf_export,
- Max
- };
-
- // -
-
-@@ -461,10 +464,23 @@
- // EGL_KHR_partial_update
- EGLBoolean fSetDamageRegion(EGLDisplay dpy, EGLSurface surface,
- const EGLint* rects, EGLint n_rects) {
- WRAP(fSetDamageRegion(dpy, surface, rects, n_rects));
- }
-+ // EGL_MESA_image_dma_buf_export
-+ EGLBoolean fExportDMABUFImageQuery(EGLDisplay dpy, EGLImage image,
-+ int* fourcc, int* num_planes,
-+ uint64_t* modifiers) {
-+ WRAP(
-+ fExportDMABUFImageQueryMESA(dpy, image, fourcc, num_planes,
modifiers));
-+ }
-+ EGLBoolean fExportDMABUFImage(EGLDisplay dpy, EGLImage image, int* fds,
-+ EGLint* strides, EGLint* offsets) {
-+ WRAP(fExportDMABUFImageMESA(dpy, image, fds, strides, offsets));
-+ }
-+
-+#undef WRAP
-
- #undef WRAP
- #undef PROFILE_CALL
- #undef BEFORE_CALL
- #undef AFTER_CALL
-@@ -593,10 +609,22 @@
- EGLBoolean(GLAPIENTRY* fSetDamageRegion)(EGLDisplay dpy, EGLSurface
surface,
- const EGLint* rects,
- EGLint n_rects);
- EGLClientBuffer(GLAPIENTRY* fGetNativeClientBufferANDROID)(
- const struct AHardwareBuffer* buffer);
-+
-+ // EGL_MESA_image_dma_buf_export
-+ EGLBoolean(GLAPIENTRY* fExportDMABUFImageQueryMESA)(EGLDisplay dpy,
-+ EGLImage image,
-+ int* fourcc,
-+ int* num_planes,
-+ uint64_t*
modifiers);
-+ EGLBoolean(GLAPIENTRY* fExportDMABUFImageMESA)(EGLDisplay dpy,
-+ EGLImage image, int* fds,
-+ EGLint* strides,
-+ EGLint* offsets);
-+
- } mSymbols = {};
- };
-
- class EglDisplay final {
- public:
-@@ -852,10 +880,23 @@
- EGLBoolean fSetDamageRegion(EGLSurface surface, const EGLint* rects,
- EGLint n_rects) {
- MOZ_ASSERT(IsExtensionSupported(EGLExtension::KHR_partial_update));
- return mLib->fSetDamageRegion(mDisplay, surface, rects, n_rects);
- }
-+
-+ EGLBoolean fExportDMABUFImageQuery(EGLImage image, int* fourcc,
-+ int* num_planes,
-+ uint64_t* modifiers) const {
-+
MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export));
-+ return mLib->fExportDMABUFImageQuery(mDisplay, image, fourcc,
num_planes,
-+ modifiers);
-+ }
-+ EGLBoolean fExportDMABUFImage(EGLImage image, int* fds, EGLint* strides,
-+ EGLint* offsets) const {
-+
MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export));
-+ return mLib->fExportDMABUFImage(mDisplay, image, fds, strides, offsets);
-+ }
- };
-
- } /* namespace gl */
- } /* namespace mozilla */
-
-diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp
---- a/gfx/gl/GLLibraryEGL.cpp
-+++ b/gfx/gl/GLLibraryEGL.cpp
-@@ -82,11 +82,14 @@
- "EGL_EXT_swap_buffers_with_damage",
- "EGL_KHR_swap_buffers_with_damage",
- "EGL_EXT_buffer_age",
- "EGL_KHR_partial_update",
- "EGL_NV_robustness_video_memory_purge",
-- "EGL_MESA_platform_surfaceless"};
-+ "EGL_MESA_platform_surfaceless",
-+ "EGL_EXT_image_dma_buf_import",
-+ "EGL_EXT_image_dma_buf_import_modifiers",
-+ "EGL_MESA_image_dma_buf_export"};
-
- PRLibrary* LoadApitraceLibrary() {
- const char* path = nullptr;
-
- #ifdef ANDROID
-@@ -647,10 +650,16 @@
- {
- const SymLoadStruct symbols[] = {SYMBOL(GetPlatformDisplay),
- END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
-+ {
-+ const SymLoadStruct symbols[] = {SYMBOL(ExportDMABUFImageQueryMESA),
-+ SYMBOL(ExportDMABUFImageMESA),
-+ END_OF_SYMBOLS};
-+ (void)fnLoadSymbols(symbols);
-+ }
-
- return true;
- }
-
- // -
-
diff --git
a/http/firefox/patches/0033-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox/patches/0033-bmo-1754469-memory_mozalloc_throw.patch
new file mode 100644
index 0000000..634892be
--- /dev/null
+++ b/http/firefox/patches/0033-bmo-1754469-memory_mozalloc_throw.patch
@@ -0,0 +1,69 @@
+--- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
++++ b/memory/mozalloc/throw_gcc.h
+@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
+ mozalloc_abort("fatal: STL threw bad_function_call");
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_invalid_argument(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
+ const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_overflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
++#if !defined(_LIBCPP_VERSION)
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
+ __throw_underflow_error(const char* msg) {
+ mozalloc_abort(msg);
+ }
++#endif // _LIBCPP_VERSION
+
+ MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
+ const char* msg) {
diff --git
a/http/firefox/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
b/http/firefox/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
deleted file mode 100644
index 52462f2..0000000
--- a/http/firefox/patches/0034-bmo-1735929-webgl-nvidia-p2-D147636.patch
+++ /dev/null
@@ -1,278 +0,0 @@
-diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h
---- a/widget/gtk/DMABufSurface.h
-+++ b/widget/gtk/DMABufSurface.h
-@@ -173,13 +173,13 @@
- SurfaceType mSurfaceType;
- uint64_t mBufferModifiers[DMABUF_BUFFER_PLANES];
-
- int mBufferPlaneCount;
- int mDmabufFds[DMABUF_BUFFER_PLANES];
-- uint32_t mDrmFormats[DMABUF_BUFFER_PLANES];
-- uint32_t mStrides[DMABUF_BUFFER_PLANES];
-- uint32_t mOffsets[DMABUF_BUFFER_PLANES];
-+ int32_t mDrmFormats[DMABUF_BUFFER_PLANES];
-+ int32_t mStrides[DMABUF_BUFFER_PLANES];
-+ int32_t mOffsets[DMABUF_BUFFER_PLANES];
-
- struct gbm_bo* mGbmBufferObject[DMABUF_BUFFER_PLANES];
- void* mMappedRegion[DMABUF_BUFFER_PLANES];
- void* mMappedRegionData[DMABUF_BUFFER_PLANES];
- uint32_t mMappedRegionStride[DMABUF_BUFFER_PLANES];
-@@ -198,10 +198,14 @@
- class DMABufSurfaceRGBA : public DMABufSurface {
- public:
- static already_AddRefed<DMABufSurfaceRGBA> CreateDMABufSurface(
- int aWidth, int aHeight, int aDMABufSurfaceFlags);
-
-+ static already_AddRefed<DMABufSurface> CreateDMABufSurface(
-+ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage,
-+ int aWidth, int aHeight);
-+
- bool Serialize(mozilla::layers::SurfaceDescriptor& aOutDescriptor);
-
- DMABufSurfaceRGBA* GetAsDMABufSurfaceRGBA() { return this; }
-
- void Clear();
-@@ -247,10 +251,12 @@
- private:
- ~DMABufSurfaceRGBA();
-
- bool Create(int aWidth, int aHeight, int aDMABufSurfaceFlags);
- bool Create(const mozilla::layers::SurfaceDescriptor& aDesc);
-+ bool Create(mozilla::gl::GLContext* aGLContext, const EGLImageKHR
aEGLImage,
-+ int aWidth, int aHeight);
-
- bool ImportSurfaceDescriptor(const mozilla::layers::SurfaceDescriptor&
aDesc);
-
- bool OpenFileDescriptorForPlane(const mozilla::MutexAutoLock&
aProofOfLock,
- int aPlane);
-diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
---- a/widget/gtk/DMABufSurface.cpp
-+++ b/widget/gtk/DMABufSurface.cpp
-@@ -204,10 +204,12 @@
- }
- }
-
- void DMABufSurface::FenceSet() {
- if (!mGL || !mGL->MakeCurrent()) {
-+ MOZ_DIAGNOSTIC_ASSERT(mGL,
-+ "DMABufSurface::FenceSet(): missing GL context!");
- return;
- }
- const auto& gle = gl::GLContextEGL::Cast(mGL);
- const auto& egl = gle->mEgl;
-
-@@ -228,21 +230,23 @@
- mGL->fFinish();
- }
-
- void DMABufSurface::FenceWait() {
- if (!mGL || mSyncFd < 0) {
-+ MOZ_DIAGNOSTIC_ASSERT(mGL,
-+ "DMABufSurface::FenceWait() missing GL context!");
- return;
- }
-
- const auto& gle = gl::GLContextEGL::Cast(mGL);
- const auto& egl = gle->mEgl;
-
- const EGLint attribs[] = {LOCAL_EGL_SYNC_NATIVE_FENCE_FD_ANDROID, mSyncFd,
- LOCAL_EGL_NONE};
- EGLSync sync = egl->fCreateSync(LOCAL_EGL_SYNC_NATIVE_FENCE_ANDROID,
attribs);
- if (!sync) {
-- MOZ_ASSERT(false, "Failed to create GLFence!");
-+ MOZ_ASSERT(false, "DMABufSurface::FenceWait(): Failed to create
GLFence!");
- // We failed to create GLFence so clear mSyncFd to avoid another try.
- close(mSyncFd);
- mSyncFd = -1;
- return;
- }
-@@ -338,17 +342,18 @@
- mGmbFormat = GetDMABufDevice()->GetGbmFormat(mSurfaceFlags &
DMABUF_ALPHA);
- if (!mGmbFormat) {
- // Requested DRM format is not supported.
- return false;
- }
-+ mDrmFormats[0] = mGmbFormat->mFormat;
-
- 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,
-+ GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight, mDrmFormats[0],
- mGmbFormat->mModifiers, mGmbFormat->mModifiersCount);
- if (mGbmBufferObject[0]) {
- mBufferModifiers[0] = nsGbmLib::GetModifier(mGbmBufferObject[0]);
- }
- }
-@@ -356,11 +361,11 @@
- if (!mGbmBufferObject[0]) {
- LOGDMABUF((" Creating without modifiers\n"));
- mGbmBufferFlags = GBM_BO_USE_LINEAR;
- mGbmBufferObject[0] =
- nsGbmLib::Create(GetDMABufDevice()->GetGbmDevice(), mWidth, mHeight,
-- mGmbFormat->mFormat, mGbmBufferFlags);
-+ mDrmFormats[0], mGbmBufferFlags);
- mBufferModifiers[0] = DRM_FORMAT_MOD_INVALID;
- }
-
- if (!mGbmBufferObject[0]) {
- LOGDMABUF((" Failed to create GbmBufferObject\n"));
-@@ -386,22 +391,51 @@
-
- LOGDMABUF((" Success\n"));
- return true;
- }
-
-+bool DMABufSurfaceRGBA::Create(mozilla::gl::GLContext* aGLContext,
-+ const EGLImageKHR aEGLImage, int aWidth,
-+ int aHeight) {
-+ LOGDMABUF(("DMABufSurfaceRGBA::Create() from EGLImage UID = %d\n", mUID));
-+ if (!aGLContext) {
-+ return false;
-+ }
-+ const auto& gle = gl::GLContextEGL::Cast(aGLContext);
-+ const auto& egl = gle->mEgl;
-+
-+ mGL = aGLContext;
-+ mWidth = aWidth;
-+ mHeight = aHeight;
-+ mEGLImage = aEGLImage;
-+ if (!egl->fExportDMABUFImageQuery(mEGLImage, mDrmFormats,
&mBufferPlaneCount,
-+ mBufferModifiers)) {
-+ LOGDMABUF((" ExportDMABUFImageQueryMESA failed, quit\n"));
-+ return false;
-+ }
-+ if (mBufferPlaneCount > DMABUF_BUFFER_PLANES) {
-+ LOGDMABUF((" wrong plane count %d, quit\n", mBufferPlaneCount));
-+ return false;
-+ }
-+ if (!egl->fExportDMABUFImage(mEGLImage, mDmabufFds, mStrides, mOffsets)) {
-+ LOGDMABUF((" ExportDMABUFImageMESA failed, quit\n"));
-+ return false;
-+ }
-+
-+ LOGDMABUF((" imported size %d x %d format %x planes %d", mWidth, mHeight,
-+ mDrmFormats[0], mBufferPlaneCount));
-+ return true;
-+}
-+
- bool DMABufSurfaceRGBA::ImportSurfaceDescriptor(
- const SurfaceDescriptor& aDesc) {
- const SurfaceDescriptorDMABuf& desc = aDesc.get_SurfaceDescriptorDMABuf();
-
- mWidth = desc.width()[0];
- mHeight = desc.height()[0];
- mBufferModifiers[0] = desc.modifier()[0];
-- if (mBufferModifiers[0] != DRM_FORMAT_MOD_INVALID) {
-- mGmbFormat = GetDMABufDevice()->GetExactGbmFormat(desc.format()[0]);
-- } else {
-- mDrmFormats[0] = desc.format()[0];
-- }
-+ mDrmFormats[0] = desc.format()[0];
- mBufferPlaneCount = desc.fds().Length();
- mGbmBufferFlags = desc.flags();
- MOZ_RELEASE_ASSERT(mBufferPlaneCount <= DMABUF_BUFFER_PLANES);
- mUID = desc.uid();
-
-@@ -431,10 +465,12 @@
-
- if (desc.refCount().Length() > 0) {
-
GlobalRefCountImport(desc.refCount()[0].ClonePlatformHandle().release());
- }
-
-+ LOGDMABUF((" imported size %d x %d format %x planes %d", mWidth, mHeight,
-+ mDrmFormats[0], mBufferPlaneCount));
- return true;
- }
-
- bool DMABufSurfaceRGBA::Create(const SurfaceDescriptor& aDesc) {
- return ImportSurfaceDescriptor(aDesc);
-@@ -460,11 +496,11 @@
- return false;
- }
-
- width.AppendElement(mWidth);
- height.AppendElement(mHeight);
-- format.AppendElement(mGmbFormat->mFormat);
-+ format.AppendElement(mDrmFormats[0]);
- modifiers.AppendElement(mBufferModifiers[0]);
- for (int i = 0; i < mBufferPlaneCount; i++) {
- fds.AppendElement(ipc::FileDescriptor(mDmabufFds[i]));
- strides.AppendElement(mStrides[i]);
- offsets.AppendElement(mOffsets[i]);
-@@ -486,23 +522,20 @@
- fenceFDs, mUID, refCountFDs);
- return true;
- }
-
- bool DMABufSurfaceRGBA::CreateTexture(GLContext* aGLContext, int aPlane) {
-+ LOGDMABUF(("DMABufSurfaceRGBA::CreateTexture() UID %d\n", mUID));
- MOZ_ASSERT(!mEGLImage && !mTexture, "EGLImage is already created!");
-
- nsTArray<EGLint> attribs;
- attribs.AppendElement(LOCAL_EGL_WIDTH);
- attribs.AppendElement(mWidth);
- attribs.AppendElement(LOCAL_EGL_HEIGHT);
- attribs.AppendElement(mHeight);
- attribs.AppendElement(LOCAL_EGL_LINUX_DRM_FOURCC_EXT);
-- if (mGmbFormat) {
-- attribs.AppendElement(mGmbFormat->mFormat);
-- } else {
-- attribs.AppendElement(mDrmFormats[0]);
-- }
-+ attribs.AppendElement(mDrmFormats[0]);
- #define ADD_PLANE_ATTRIBS(plane_idx)
\
- {
\
- attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_FD_EXT);
\
- attribs.AppendElement(mDmabufFds[plane_idx]);
\
- attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_OFFSET_EXT);
\
-@@ -560,10 +593,11 @@
-
- return true;
- }
-
- void DMABufSurfaceRGBA::ReleaseTextures() {
-+ LOGDMABUF(("DMABufSurfaceRGBA::ReleaseTextures() UID %d\n", mUID));
- FenceDelete();
-
- if (!mTexture) {
- return;
- }
-@@ -618,11 +652,11 @@
- zwp_linux_buffer_params_v1_add(params, mDmabufFds[0], 0, mOffsets[0],
- mStrides[0], mBufferModifiers[0] >> 32,
- mBufferModifiers[0] & 0xffffffff);
-
- mWlBuffer = zwp_linux_buffer_params_v1_create_immed(
-- params, GetWidth(), GetHeight(), mGmbFormat->mFormat, 0);
-+ params, GetWidth(), GetHeight(), mDrmFormats[0], 0);
-
- CloseFileDescriptors(lockFD);
-
- return mWlBuffer != nullptr;
- }
-@@ -806,10 +840,20 @@
- return nullptr;
- }
- return surf.forget();
- }
-
-+already_AddRefed<DMABufSurface> DMABufSurfaceRGBA::CreateDMABufSurface(
-+ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage, int
aWidth,
-+ int aHeight) {
-+ RefPtr<DMABufSurfaceRGBA> surf = new DMABufSurfaceRGBA();
-+ if (!surf->Create(aGLContext, aEGLImage, aWidth, aHeight)) {
-+ return nullptr;
-+ }
-+ return surf.forget();
-+}
-+
- already_AddRefed<DMABufSurfaceYUV> DMABufSurfaceYUV::CreateYUVSurface(
- const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) {
- RefPtr<DMABufSurfaceYUV> surf = new DMABufSurfaceYUV();
- LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n",
- surf->GetUID()));
-
diff --git
a/http/firefox/patches/0034-bmo-1769631-python-3.11-compatibility.patch
b/http/firefox/patches/0034-bmo-1769631-python-3.11-compatibility.patch
new file mode 100644
index 0000000..97ac3ce
--- /dev/null
+++ b/http/firefox/patches/0034-bmo-1769631-python-3.11-compatibility.patch
@@ -0,0 +1,30 @@
+#
https://src.fedoraproject.org/rpms/firefox/c/4d45de9bff7b7ef01f7d3c9e53a61adc9cf3ce9e?branch=4d45de9bff7b7ef01f7d3c9e53a61adc9cf3ce9e
+
+diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.build-python-3.11
firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py
+--- firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.build-python-3.11
2022-06-23 09:10:31.000000000 +0200
++++ firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-15
16:18:52.048351493 +0200
+@@ -1572,13 +1572,13 @@ class IDLParser(object):
+ t_ignore = " \t"
+
+ def t_multilinecomment(self, t):
+- r"/\*(?s).*?\*/"
++ r"/\*(?s:.)*?\*/"
+ t.lexer.lineno += t.value.count("\n")
+ if t.value.startswith("/**"):
+ self._doccomments.append(t.value)
+
+ def t_singlelinecomment(self, t):
+- r"(?m)//.*?$"
++ r"(?m://.*?$)"
+
+ def t_IID(self, t):
+ return t
+@@ -1591,7 +1591,7 @@ class IDLParser(object):
+ return t
+
+ def t_LCDATA(self, t):
+- r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
++ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?)"
+ t.type = "CDATA"
+ t.value = t.lexer.lexmatch.group("cdata")
+ t.lexer.lineno += t.value.count("\n")
diff --git
a/http/firefox/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
b/http/firefox/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
deleted file mode 100644
index 89bb25e..0000000
--- a/http/firefox/patches/0035-bmo-1735929-webgl-nvidia-p3-D147637.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-diff -up firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff
firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp
---- firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff 2022-06-23
09:08:46.000000000 +0200
-+++ firefox-102.0/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-28
16:37:52.264835137 +0200
-@@ -9,25 +9,58 @@
- #include "GLContextEGL.h"
- #include "MozFramebuffer.h"
- #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc
-+#include "mozilla/gfx/gfxVars.h"
-
- namespace mozilla::gl {
-
-+static bool HasDmaBufExtensions(const GLContextEGL* gl) {
-+ const auto& egl = *(gl->mEgl);
-+ return egl.IsExtensionSupported(EGLExtension::EXT_image_dma_buf_import) &&
-+ egl.IsExtensionSupported(
-+ EGLExtension::EXT_image_dma_buf_import_modifiers) &&
-+ egl.IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export);
-+}
-+
- /*static*/
- UniquePtr<SharedSurface_DMABUF> SharedSurface_DMABUF::Create(
- const SharedSurfaceDesc& desc) {
-- const auto flags = static_cast<DMABufSurfaceFlags>(
-- DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA);
-- const RefPtr<DMABufSurface> surface =
DMABufSurfaceRGBA::CreateDMABufSurface(
-- desc.size.width, desc.size.height, flags);
-- if (!surface || !surface->CreateTexture(desc.gl)) {
-- return nullptr;
-+ const auto& gle = GLContextEGL::Cast(desc.gl);
-+ const auto& context = gle->mContext;
-+ const auto& egl = *(gle->mEgl);
-+
-+ RefPtr<DMABufSurface> surface;
-+ UniquePtr<MozFramebuffer> fb;
-+
-+ if (!HasDmaBufExtensions(gle) || !gfx::gfxVars::UseDMABufSurfaceExport())
{
-+ // Use MESA_image_dma_buf_export is not supported or it's broken.
-+ // Create dmabuf surface directly via. GBM and create
-+ // EGLImage/framebuffer over it.
-+ const auto flags = static_cast<DMABufSurfaceFlags>(
-+ DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA);
-+ surface = DMABufSurfaceRGBA::CreateDMABufSurface(desc.size.width,
-+ desc.size.height,
flags);
-+ if (!surface || !surface->CreateTexture(desc.gl)) {
-+ return nullptr;
-+ }
-+ const auto tex = surface->GetTexture();
-+ fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false,
-+ LOCAL_GL_TEXTURE_2D, tex);
-+ if (!fb) return nullptr;
-+ } else {
-+ // Use MESA_image_dma_buf_export so create EGLImage/framebuffer directly
-+ // and derive dmabuf from it.
-+ fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false);
-+ if (!fb) return nullptr;
-+
-+ const auto buffer = reinterpret_cast<EGLClientBuffer>(fb->ColorTex());
-+ const auto image =
-+ egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr);
-+ if (!image) return nullptr;
-+
-+ surface = DMABufSurfaceRGBA::CreateDMABufSurface(
-+ desc.gl, image, desc.size.width, desc.size.height);
-+ if (!surface) return nullptr;
- }
--
-- const auto tex = surface->GetTexture();
-- auto fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false,
-- LOCAL_GL_TEXTURE_2D, tex);
-- if (!fb) return nullptr;
--
- return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface));
- }
-
-@@ -61,7 +94,7 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
- }
-
- auto dmabufFactory = MakeUnique<SurfaceFactory_DMABUF>(gl);
-- if (dmabufFactory->CanCreateSurface()) {
-+ if (dmabufFactory->CanCreateSurface(gl)) {
- return dmabufFactory;
- }
-
-@@ -71,8 +104,38 @@ UniquePtr<SurfaceFactory_DMABUF> Surface
- return nullptr;
- }
-
-+bool SurfaceFactory_DMABUF::CanCreateSurface(GLContext& gl) {
-+ UniquePtr<SharedSurface> test =
-+ CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB);
-+ if (!test) {
-+ LOGDMABUF((
-+ "SurfaceFactory_DMABUF::CanCreateSurface() failed to create
surface."));
-+ return false;
-+ }
-+ auto desc = test->ToSurfaceDescriptor();
-+ if (!desc) {
-+ LOGDMABUF(
-+ ("SurfaceFactory_DMABUF::CanCreateSurface() failed to serialize "
-+ "surface."));
-+ return false;
-+ }
-+ RefPtr<DMABufSurface> importedSurface =
-+ DMABufSurface::CreateDMABufSurface(*desc);
-+ if (!importedSurface) {
-+ LOGDMABUF((
-+ "SurfaceFactory_DMABUF::CanCreateSurface() failed to import
surface."));
-+ return false;
-+ }
-+ if (!importedSurface->CreateTexture(&gl)) {
-+ LOGDMABUF(
-+ ("SurfaceFactory_DMABUF::CanCreateSurface() failed to create
texture "
-+ "over surface."));
-+ return false;
-+ }
-+ return true;
-+}
-+
- SurfaceFactory_DMABUF::SurfaceFactory_DMABUF(GLContext& gl)
- : SurfaceFactory({&gl, SharedSurfaceType::EGLSurfaceDMABUF,
- layers::TextureType::DMABUF, true}) {}
--
- } // namespace mozilla::gl
-diff -up firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff
firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h
---- firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/gl/SharedSurfaceDMABUF.h 2022-06-28 15:00:20.339991965
+0200
-@@ -59,11 +59,7 @@ class SurfaceFactory_DMABUF : public Sur
- return SharedSurface_DMABUF::Create(desc);
- }
-
-- bool CanCreateSurface() {
-- UniquePtr<SharedSurface> test =
-- CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB);
-- return test != nullptr;
-- }
-+ bool CanCreateSurface(GLContext& gl);
- };
-
- } // namespace gl
diff --git a/http/firefox/patches/0036-bmo-1773968-webgl-memory-leak.patch
b/http/firefox/patches/0036-bmo-1773968-webgl-memory-leak.patch
deleted file mode 100644
index 6e93f2b..0000000
--- a/http/firefox/patches/0036-bmo-1773968-webgl-memory-leak.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp
---- a/widget/gtk/DMABufSurface.cpp
-+++ b/widget/gtk/DMABufSurface.cpp
-@@ -642,11 +642,11 @@
-
- void DMABufSurfaceRGBA::ReleaseTextures() {
- LOGDMABUF(("DMABufSurfaceRGBA::ReleaseTextures() UID %d\n", mUID));
- FenceDelete();
-
-- if (!mTexture) {
-+ if (!mTexture && mEGLImage == LOCAL_EGL_NO_IMAGE) {
- return;
- }
-
- if (!mGL) {
- #ifdef NIGHTLY
-@@ -663,17 +663,17 @@
- const auto& egl = gle->mEgl;
-
- if (mTexture && mGL->MakeCurrent()) {
- mGL->fDeleteTextures(1, &mTexture);
- mTexture = 0;
-- mGL = nullptr;
- }
-
- if (mEGLImage != LOCAL_EGL_NO_IMAGE) {
- egl->fDestroyImage(mEGLImage);
- mEGLImage = LOCAL_EGL_NO_IMAGE;
- }
-+ mGL = nullptr;
- }
-
- void DMABufSurfaceRGBA::ReleaseSurface() {
- MOZ_ASSERT(!IsMapped(), "We can't release mapped buffer!");
-
-@@ -1325,11 +1325,11 @@
-
- FenceDelete();
-
- bool textureActive = false;
- for (int i = 0; i < mBufferPlaneCount; i++) {
-- if (mTexture[i]) {
-+ if (mTexture[i] || mEGLImage[i] != LOCAL_EGL_NO_IMAGE) {
- textureActive = true;
- break;
- }
- }
-
-@@ -1346,18 +1346,23 @@
- "leaking textures!");
- return;
- #endif
- }
-
-- if (textureActive && mGL->MakeCurrent()) {
-- mGL->fDeleteTextures(DMABUF_BUFFER_PLANES, mTexture);
-- for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) {
-- mTexture[i] = 0;
-- }
-- ReleaseEGLImages(mGL);
-- mGL = nullptr;
-+ if (!mGL->MakeCurrent()) {
-+ NS_WARNING(
-+ "DMABufSurfaceYUV::ReleaseTextures(): Failed to create GL context "
-+ "current. We're leaking textures!");
-+ return;
- }
-+
-+ mGL->fDeleteTextures(DMABUF_BUFFER_PLANES, mTexture);
-+ for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) {
-+ mTexture[i] = 0;
-+ }
-+ ReleaseEGLImages(mGL);
-+ mGL = nullptr;
- }
-
- bool DMABufSurfaceYUV::VerifyTextureCreation() {
- LOGDMABUF(("DMABufSurfaceYUV::VerifyTextureCreation() UID %d", mUID));
-
-
diff --git a/http/firefox/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
b/http/firefox/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
deleted file mode 100644
index 7bc99e4..0000000
--- a/http/firefox/patches/0037-bmo-1758948-vaapi-fixes-p2-p4.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-changeset: 623785:a6b80ee8c35f
-tag: tip
-parent: 623782:b1ed2fa50612
-user: stransky <stransky AT redhat.com>
-date: Wed Jun 15 14:54:19 2022 +0200
-files: dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-description:
-Bug 1758948 [FFmpeg] Use AVFrame::pts instead of AVFrame::pkt_pts on ffmpeg
4.x r?alwu
-
-AVFrame::pkt_pts has been deprecated and gives us wrong values for AV1
VA-API. Let's use AVFrame::pts instead on ffmpeg 4.x
-as well as we use on ffmpeg 5.0 where AVFrame::pkt_pts is removed.
-
-Differential Revision: https://phabricator.services.mozilla.com/D149386
-
-
-diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
-@@ -774,7 +774,7 @@ void FFmpegVideoDecoder<LIBAV_VER>::Init
- #endif
-
- static int64_t GetFramePts(AVFrame* aFrame) {
--#if LIBAVCODEC_VERSION_MAJOR > 58
-+#if LIBAVCODEC_VERSION_MAJOR > 57
- return aFrame->pts;
- #else
- return aFrame->pkt_pts;
-
diff --git
a/http/firefox/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
b/http/firefox/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
deleted file mode 100644
index 0ab7380..0000000
--- a/http/firefox/patches/0038-bmo-1773377-vaapi-fixes-p2-p2-D148946.patch
+++ /dev/null
@@ -1,250 +0,0 @@
-diff -up firefox-102.0/gfx/gl/GLContextProviderEGL.cpp.D148946.diff
firefox-102.0/gfx/gl/GLContextProviderEGL.cpp
---- firefox-102.0/gfx/gl/GLContextProviderEGL.cpp.D148946.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/gl/GLContextProviderEGL.cpp 2022-06-28
14:47:40.904700050 +0200
-@@ -1182,42 +1182,16 @@ RefPtr<GLContextEGL> GLContextEGL::Creat
- }
-
- /*static*/
--RefPtr<GLContextEGL> GLContextEGL::CreateEGLSurfacelessContext(
-- const std::shared_ptr<EglDisplay> display, const GLContextCreateDesc&
desc,
-- nsACString* const out_failureId) {
-- const EGLConfig config = {};
-- auto fullDesc = GLContextDesc{desc};
-- fullDesc.isOffscreen = true;
-- RefPtr<GLContextEGL> gl = GLContextEGL::CreateGLContext(
-- display, fullDesc, config, EGL_NO_SURFACE, false, out_failureId);
-- if (!gl) {
-- NS_WARNING("Failed to create surfaceless GL context");
-- return nullptr;
-- }
-- return gl;
--}
--
--/*static*/
- already_AddRefed<GLContext> GLContextProviderEGL::CreateHeadless(
- const GLContextCreateDesc& desc, nsACString* const out_failureId) {
- const auto display = DefaultEglDisplay(out_failureId);
- if (!display) {
- return nullptr;
- }
-- RefPtr<GLContextEGL> gl;
--#ifdef MOZ_WAYLAND
-- if (!gdk_display_get_default() &&
--
display->IsExtensionSupported(EGLExtension::MESA_platform_surfaceless)) {
-- gl =
-- GLContextEGL::CreateEGLSurfacelessContext(display, desc,
out_failureId);
-- } else
--#endif
-- {
-- mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
-- gl = GLContextEGL::CreateEGLPBufferOffscreenContext(
-- display, desc, dummySize, out_failureId);
-- }
-- return gl.forget();
-+ mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16);
-+ auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext(
-+ display, desc, dummySize, out_failureId);
-+ return ret.forget();
- }
-
- // Don't want a global context on Android as 1) share groups across 2
threads
-diff -up firefox-102.0/gfx/gl/GLDefs.h.D148946.diff
firefox-102.0/gfx/gl/GLDefs.h
---- firefox-102.0/gfx/gl/GLDefs.h.D148946.diff 2022-06-23 09:08:47.000000000
+0200
-+++ firefox-102.0/gfx/gl/GLDefs.h 2022-06-28 14:47:40.904700050 +0200
-@@ -104,9 +104,6 @@ bool CheckContextLost(const GLContext* g
- // EGL_ANGLE_image_d3d11_texture
- #define LOCAL_EGL_D3D11_TEXTURE_ANGLE 0x3484
-
--// EGL_MESA_platform_surfaceless
--#define LOCAL_EGL_PLATFORM_SURFACELESS_MESA 0x31DD
--
- // clang-format on
-
- #endif
-diff -up firefox-102.0/gfx/gl/GLLibraryEGL.cpp.D148946.diff
firefox-102.0/gfx/gl/GLLibraryEGL.cpp
---- firefox-102.0/gfx/gl/GLLibraryEGL.cpp.D148946.diff 2022-06-28
14:47:40.900699918 +0200
-+++ firefox-102.0/gfx/gl/GLLibraryEGL.cpp 2022-06-28 14:49:47.810911199
+0200
-@@ -54,9 +54,15 @@ StaticRefPtr<GLLibraryEGL> GLLibraryEGL:
-
- // should match the order of EGLExtensions, and be null-terminated.
- static const char* sEGLLibraryExtensionNames[] = {
-- "EGL_ANDROID_get_native_client_buffer", "EGL_ANGLE_device_creation",
-- "EGL_ANGLE_device_creation_d3d11", "EGL_ANGLE_platform_angle",
-- "EGL_ANGLE_platform_angle_d3d", "EGL_EXT_device_query"};
-+ "EGL_ANDROID_get_native_client_buffer",
-+ "EGL_ANGLE_device_creation",
-+ "EGL_ANGLE_device_creation_d3d11",
-+ "EGL_ANGLE_platform_angle",
-+ "EGL_ANGLE_platform_angle_d3d",
-+ "EGL_EXT_device_enumeration",
-+ "EGL_EXT_device_query",
-+ "EGL_EXT_platform_device",
-+ "EGL_MESA_platform_surfaceless"};
-
- // should match the order of EGLExtensions, and be null-terminated.
- static const char* sEGLExtensionNames[] = {
-@@ -84,7 +90,6 @@ static const char* sEGLExtensionNames[]
- "EGL_EXT_buffer_age",
- "EGL_KHR_partial_update",
- "EGL_NV_robustness_video_memory_purge",
-- "EGL_MESA_platform_surfaceless",
- "EGL_EXT_image_dma_buf_import",
- "EGL_EXT_image_dma_buf_import_modifiers",
- "EGL_MESA_image_dma_buf_export"};
-@@ -157,8 +162,52 @@ static std::shared_ptr<EglDisplay> GetAn
- }
-
- #ifdef MOZ_WAYLAND
-+static std::shared_ptr<EglDisplay> GetAndInitDeviceDisplay(
-+ GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) {
-+ nsAutoCString drmRenderDevice(gfx::gfxVars::DrmRenderDevice());
-+ if (drmRenderDevice.IsEmpty() ||
-+ !egl.IsExtensionSupported(EGLLibExtension::EXT_platform_device) ||
-+ !egl.IsExtensionSupported(EGLLibExtension::EXT_device_enumeration)) {
-+ return nullptr;
-+ }
-+
-+ EGLint maxDevices;
-+ if (!egl.fQueryDevicesEXT(0, nullptr, &maxDevices)) {
-+ return nullptr;
-+ }
-+
-+ std::vector<EGLDeviceEXT> devices(maxDevices);
-+ EGLint numDevices;
-+ if (!egl.fQueryDevicesEXT(devices.size(), devices.data(), &numDevices)) {
-+ return nullptr;
-+ }
-+ devices.resize(numDevices);
-+
-+ EGLDisplay display = EGL_NO_DISPLAY;
-+ for (const auto& device : devices) {
-+ const char* renderNodeString =
-+ egl.fQueryDeviceStringEXT(device,
LOCAL_EGL_DRM_RENDER_NODE_FILE_EXT);
-+ if (renderNodeString &&
-+ strcmp(renderNodeString, drmRenderDevice.get()) == 0) {
-+ const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
-+ display = egl.fGetPlatformDisplay(LOCAL_EGL_PLATFORM_DEVICE_EXT,
device,
-+ attrib_list);
-+ break;
-+ }
-+ }
-+ if (!display) {
-+ return nullptr;
-+ }
-+
-+ return EglDisplay::Create(egl, display, true, aProofOfLock);
-+}
-+
- static std::shared_ptr<EglDisplay> GetAndInitSurfacelessDisplay(
- GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) {
-+ if
(!egl.IsExtensionSupported(EGLLibExtension::MESA_platform_surfaceless)) {
-+ return nullptr;
-+ }
-+
- const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE};
- const EGLDisplay display = egl.fGetPlatformDisplay(
- LOCAL_EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY,
attrib_list);
-@@ -611,9 +660,9 @@ bool GLLibraryEGL::Init(nsACString* cons
- (void)fnLoadSymbols(symbols);
- }
- {
-- const SymLoadStruct symbols[] = {SYMBOL(QueryDisplayAttribEXT),
-- SYMBOL(QueryDeviceAttribEXT),
-- END_OF_SYMBOLS};
-+ const SymLoadStruct symbols[] = {
-+ SYMBOL(QueryDisplayAttribEXT), SYMBOL(QueryDeviceAttribEXT),
-+ SYMBOL(QueryDeviceStringEXT), END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
- {
-@@ -658,6 +707,10 @@ bool GLLibraryEGL::Init(nsACString* cons
- END_OF_SYMBOLS};
- (void)fnLoadSymbols(symbols);
- }
-+ {
-+ const SymLoadStruct symbols[] = {SYMBOL(QueryDevicesEXT),
END_OF_SYMBOLS};
-+ (void)fnLoadSymbols(symbols);
-+ }
-
- return true;
- }
-@@ -835,7 +888,10 @@ std::shared_ptr<EglDisplay> GLLibraryEGL
- #ifdef MOZ_WAYLAND
- GdkDisplay* gdkDisplay = gdk_display_get_default();
- if (!gdkDisplay) {
-- ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
-+ ret = GetAndInitDeviceDisplay(*this, aProofOfLock);
-+ if (!ret) {
-+ ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock);
-+ }
- } else if (widget::GdkIsWaylandDisplay(gdkDisplay)) {
- // Wayland does not support EGL_DEFAULT_DISPLAY
- nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay);
-diff -up firefox-102.0/gfx/gl/GLLibraryEGL.h.D148946.diff
firefox-102.0/gfx/gl/GLLibraryEGL.h
---- firefox-102.0/gfx/gl/GLLibraryEGL.h.D148946.diff 2022-06-28
14:47:40.899699885 +0200
-+++ firefox-102.0/gfx/gl/GLLibraryEGL.h 2022-06-28 14:47:40.904700050
+0200
-@@ -71,7 +71,10 @@ enum class EGLLibExtension {
- ANGLE_device_creation_d3d11,
- ANGLE_platform_angle,
- ANGLE_platform_angle_d3d,
-+ EXT_device_enumeration,
- EXT_device_query,
-+ EXT_platform_device,
-+ MESA_platform_surfaceless,
- Max
- };
-
-@@ -107,7 +110,6 @@ enum class EGLExtension {
- EXT_buffer_age,
- KHR_partial_update,
- NV_robustness_video_memory_purge,
-- MESA_platform_surfaceless,
- EXT_image_dma_buf_import,
- EXT_image_dma_buf_import_modifiers,
- MESA_image_dma_buf_export,
-@@ -436,6 +438,10 @@ class GLLibraryEGL final {
- WRAP(fQueryDeviceAttribEXT(device, attribute, value));
- }
-
-+ const char* fQueryDeviceStringEXT(EGLDeviceEXT device, EGLint name) {
-+ WRAP(fQueryDeviceStringEXT(device, name));
-+ }
-+
- private:
- // NV_stream_consumer_gltexture_yuv
- EGLBoolean fStreamConsumerGLTextureExternalAttribsNV(
-@@ -478,6 +484,13 @@ class GLLibraryEGL final {
- WRAP(fExportDMABUFImageMESA(dpy, image, fds, strides, offsets));
- }
-
-+ public:
-+ // EGL_EXT_device_enumeration
-+ EGLBoolean fQueryDevicesEXT(EGLint max_devices, EGLDeviceEXT* devices,
-+ EGLint* num_devices) {
-+ WRAP(fQueryDevicesEXT(max_devices, devices, num_devices));
-+ }
-+
- #undef WRAP
-
- #undef WRAP
-@@ -586,6 +599,9 @@ class GLLibraryEGL final {
- EGLBoolean(GLAPIENTRY* fQueryDeviceAttribEXT)(EGLDeviceEXT device,
- EGLint attribute,
- EGLAttrib* value);
-+ const char*(GLAPIENTRY* fQueryDeviceStringEXT)(EGLDeviceEXT device,
-+ EGLint name);
-+
- // NV_stream_consumer_gltexture_yuv
- EGLBoolean(GLAPIENTRY* fStreamConsumerGLTextureExternalAttribsNV)(
- EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib* attrib_list);
-@@ -623,6 +639,10 @@ class GLLibraryEGL final {
- EGLint* strides,
- EGLint* offsets);
-
-+ EGLBoolean(GLAPIENTRY* fQueryDevicesEXT)(EGLint max_devices,
-+ EGLDeviceEXT* devices,
-+ EGLint* num_devices);
-+
- } mSymbols = {};
- };
-
diff --git
a/http/firefox/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
b/http/firefox/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
deleted file mode 100644
index e89c1bf..0000000
--- a/http/firefox/patches/0039-bmo-1774075-vaapi-fixes-p2-p3-D149238.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -up firefox-102.0/gfx/config/gfxVars.h.D149238.diff
firefox-102.0/gfx/config/gfxVars.h
---- firefox-102.0/gfx/config/gfxVars.h.D149238.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/config/gfxVars.h 2022-06-28 16:40:54.130895063 +0200
-@@ -91,7 +91,8 @@ class gfxVarReceiver;
- _(AllowWebGPU, bool, false) \
- _(UseVP8HwDecode, bool, false) \
- _(UseVP9HwDecode, bool, false) \
-- _(HwDecodedVideoZeroCopy, bool, false)
-+ _(HwDecodedVideoZeroCopy, bool, false) \
-+ _(UseDMABufSurfaceExport, bool, true)
-
- /* Add new entries above this line. */
-
-diff -up firefox-102.0/gfx/thebes/gfxPlatform.cpp.D149238.diff
firefox-102.0/gfx/thebes/gfxPlatform.cpp
---- firefox-102.0/gfx/thebes/gfxPlatform.cpp.D149238.diff 2022-06-23
09:08:47.000000000 +0200
-+++ firefox-102.0/gfx/thebes/gfxPlatform.cpp 2022-06-28 16:40:54.130895063
+0200
-@@ -2861,6 +2861,17 @@ void gfxPlatform::InitWebGLConfig() {
- gfxVars::SetAllowEglRbab(false);
- }
- }
-+
-+ if (kIsWayland || kIsX11) {
-+ // Disable EGL_MESA_image_dma_buf_export on mesa/radeonsi due to
-+ // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666
-+ nsString adapterDriverVendor;
-+ gfxInfo->GetAdapterDriverVendor(adapterDriverVendor);
-+ if (adapterDriverVendor.Find("mesa") != -1 &&
-+ adapterDriverVendor.Find("radeonsi") != -1) {
-+ gfxVars::SetUseDMABufSurfaceExport(false);
-+ }
-+ }
- }
-
- void gfxPlatform::InitWebGPUConfig() {
diff --git a/http/firefox/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
b/http/firefox/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
deleted file mode 100644
index 689e584..0000000
--- a/http/firefox/patches/0040-bmo-1774271-vaapi-fixes-p2-p5.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-
-# HG changeset patch
-# User Martin Stransky <stransky AT redhat.com>
-# Date 1656309292 0
-# Node ID 6dce488087f13c4ffe6ba0c758362968a8e60704
-# Parent 00ef31a00437f25556606342668f1125e86c55b4
-Bug 1774271 [Linux] Use DMABUF_SURFACE_EXPORT feature to control dmabuf
surface export from EGLImage and disable that on Mesa/Intel and Mesa/AMD
r=jgilbert
-
-Differential Revision: https://phabricator.services.mozilla.com/D149984
-
-diff --git a/gfx/config/gfxFeature.h b/gfx/config/gfxFeature.h
---- a/gfx/config/gfxFeature.h
-+++ b/gfx/config/gfxFeature.h
-@@ -38,17 +38,18 @@ namespace gfx {
- _(WEBGPU, Feature, "WebGPU")
\
- _(X11_EGL, Feature, "X11 EGL")
\
- _(DMABUF, Feature, "DMABUF")
\
- _(WINDOW_OCCLUSION, Feature, "WINDOW_OCCLUSION")
\
- _(VAAPI, Feature, "VA-API video decoding")
\
- _(VIDEO_OVERLAY, Feature, "video overlay")
\
- _(HW_DECODED_VIDEO_ZERO_COPY, Feature, "Hardware decoded video zero
copy") \
- _(VP8_HW_DECODE, Feature, "VP8 hardware decoding")
\
-- _(VP9_HW_DECODE, Feature, "VP9 hardware decoding")
-+ _(VP9_HW_DECODE, Feature, "VP9 hardware decoding")
\
-+ _(DMABUF_SURFACE_EXPORT, Feature, "WebGL DMABuf surface export")
- /* Add new entries above this comment */
-
- enum class Feature : uint32_t {
- #define MAKE_ENUM(name, type, desc) name,
- GFX_FEATURE_MAP(MAKE_ENUM)
- #undef MAKE_ENUM
- NumValues
- };
-diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
---- a/gfx/thebes/gfxPlatform.cpp
-+++ b/gfx/thebes/gfxPlatform.cpp
-@@ -2806,23 +2806,29 @@ void gfxPlatform::InitWebGLConfig() {
- nsAutoString renderer;
- gfxInfo->GetAdapterDeviceID(renderer);
- if (renderer.Find("Adreno (TM) 630") != -1) {
- gfxVars::SetAllowEglRbab(false);
- }
- }
-
- if (kIsWayland || kIsX11) {
-- // Disable EGL_MESA_image_dma_buf_export on mesa/radeonsi due to
-- // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666
-- nsString adapterDriverVendor;
-- gfxInfo->GetAdapterDriverVendor(adapterDriverVendor);
-- if (adapterDriverVendor.Find("mesa") != -1 &&
-- adapterDriverVendor.Find("radeonsi") != -1) {
-+ nsCString discardFailureId;
-+ int32_t status;
-+ FeatureState& feature =
-+ gfxConfig::GetFeature(Feature::DMABUF_SURFACE_EXPORT);
-+ if (NS_FAILED(
-+
gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ discardFailureId, &status)) ||
-+ status != nsIGfxInfo::FEATURE_STATUS_OK) {
-+ feature.DisableByDefault(FeatureStatus::Blocked, "Blocklisted by
gfxInfo",
-+ discardFailureId);
- gfxVars::SetUseDMABufSurfaceExport(false);
-+ } else {
-+ feature.EnableByDefault();
- }
- }
- }
-
- void gfxPlatform::InitWebGPUConfig() {
- if (!XRE_IsParentProcess()) {
- return;
- }
-diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
---- a/widget/GfxInfoBase.cpp
-+++ b/widget/GfxInfoBase.cpp
-@@ -249,16 +249,19 @@ static const char* GetPrefNameForFeature
- name = BLOCKLIST_PREF_BRANCH "hw-video-zero-copy";
- break;
- case nsIGfxInfo::FEATURE_WEBRENDER_SHADER_CACHE:
- name = BLOCKLIST_PREF_BRANCH "webrender.program-binary-disk";
- break;
- case nsIGfxInfo::FEATURE_WEBRENDER_PARTIAL_PRESENT:
- name = BLOCKLIST_PREF_BRANCH "webrender.partial-present";
- break;
-+ case nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT:
-+ name = BLOCKLIST_PREF_BRANCH "dmabuf.surface-export";
-+ break;
- default:
- MOZ_ASSERT_UNREACHABLE("Unexpected nsIGfxInfo feature?!");
- break;
- }
-
- return name;
- }
-
-diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp
---- a/widget/gtk/GfxInfo.cpp
-+++ b/widget/gtk/GfxInfo.cpp
-@@ -822,16 +822,32 @@ const nsTArray<GfxDriverInfo>& GfxInfo::
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
- DesktopEnvironment::All, WindowProtocol::All,
DriverVendor::NonMesaAll,
- DeviceFamily::NvidiaAll, nsIGfxInfo::FEATURE_DMABUF,
- nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
- V(495, 44, 0, 0), "FEATURE_FAILURE_NO_GBM", "495.44.0");
-
- ////////////////////////////////////
-+ // FEATURE_DMABUF_SURFACE_EXPORT
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
-+ V(21, 1, 2, 0), "FEATURE_FAILURE_BROKEN_MESA", "22.1.2");
-+
-+ APPEND_TO_DRIVER_BLOCKLIST_EXT(
-+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
-+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
-+ DeviceFamily::IntelAll, nsIGfxInfo::FEATURE_DMABUF_SURFACE_EXPORT,
-+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED,
-+ V(0, 0, 0, 0), "FEATURE_FAILURE_BROKEN_DRIVER", "");
-+
-+ ////////////////////////////////////
- // FEATURE_VAAPI
- APPEND_TO_DRIVER_BLOCKLIST_EXT(
- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All,
- DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll,
- DeviceFamily::All, nsIGfxInfo::FEATURE_VAAPI,
- nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN,
- V(21, 0, 0, 0), "FEATURE_ROLLOUT_VAAPI_MESA", "Mesa 21.0.0.0");
-
-diff --git a/widget/nsIGfxInfo.idl b/widget/nsIGfxInfo.idl
---- a/widget/nsIGfxInfo.idl
-+++ b/widget/nsIGfxInfo.idl
-@@ -171,16 +171,18 @@ interface nsIGfxInfo : nsISupports
- /* Whether VA-API is supported, starting in 96. */
- const long FEATURE_VAAPI = 37;
- /* Whether WebGPU is supported, starting in 100. */
- const long FEATURE_WEBGPU = 38;
- /* Whether video overlay is supported, starting in 100. */
- const long FEATURE_VIDEO_OVERLAY = 39;
- /* Whether hardware decoded video zero copy is supported, starting in
101. */
- const long FEATURE_HW_DECODED_VIDEO_ZERO_COPY = 40;
-+ /* Whether DMABUF export is supported, starting in 103. */
-+ const long FEATURE_DMABUF_SURFACE_EXPORT = 41;
- /* the maximum feature value. */
- const long FEATURE_MAX_VALUE = FEATURE_HW_DECODED_VIDEO_ZERO_COPY;
-
- /*
- * A set of return values from GetFeatureStatus
- */
-
- /* The driver is safe to the best of our knowledge */
-
diff --git
a/http/firefox/patches/0041-p01-bmo-1772719-build-wayland-only.patch
b/http/firefox/patches/0041-p01-bmo-1772719-build-wayland-only.patch
deleted file mode 100644
index 697d608..0000000
--- a/http/firefox/patches/0041-p01-bmo-1772719-build-wayland-only.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-
-# HG changeset patch
-# User ganguin <ganguin>
-# Date 1654600180 0
-# Node ID 2e739b8c44c72cfcd603a34217c7ca8d8a99c6e3
-# Parent 4d909088d95c2addd0309c2d81d89dae0c4537ea
-Bug 1772719 - fix wayland-only build with mesa X11 support r=stransky
-
-this patch fixes building firefox with
---enable-default-toolkit=cairo-gtk3-wayland-only when system mesa is build
-with X11 support.
-
-Without this patch, it only builds with mesa built without X11 support.
-
-Differential Revision: https://phabricator.services.mozilla.com/D148347
-
-diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
---- a/widget/gtk/nsClipboard.cpp
-+++ b/widget/gtk/nsClipboard.cpp
-@@ -34,12 +34,15 @@
- #include "mozilla/SchedulerGroup.h"
- #include "mozilla/StaticPrefs_widget.h"
- #include "mozilla/TimeStamp.h"
-+#include "GRefPtr.h"
- #include "WidgetUtilsGtk.h"
-
- #include "imgIContainer.h"
-
- #include <gtk/gtk.h>
--#include <gtk/gtkx.h>
-+#if defined(MOZ_X11)
-+# include <gtk/gtkx.h>
-+#endif
-
- #include "mozilla/Encoding.h"
-
diff --git
a/http/firefox/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch

b/http/firefox/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
deleted file mode 100644
index 22a9cb0..0000000
---
a/http/firefox/patches/0042-p02-bmo-1772721-build-wayland-only-D148496fixed.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/widget/gtk/mozgtk/moz.build b/widget/gtk/mozgtk/moz.build
---- a/widget/gtk/mozgtk/moz.build
-+++ b/widget/gtk/mozgtk/moz.build
-@@ -9,10 +9,11 @@
- SOURCES += [
- "mozgtk.c",
- ]
-
- CFLAGS += CONFIG["MOZ_X11_CFLAGS"]
-+CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
-
- # If LDFLAGS contains -Wl,--as-needed or if it's the default for the
toolchain,
- # we need to add -Wl,--no-as-needed before the gtk libraries, otherwise the
- # linker will drop those dependencies because no symbols are used from them.
- # But those dependencies need to be kept for things to work properly.
-diff --git a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
---- a/widget/gtk/mozgtk/mozgtk.c
-+++ b/widget/gtk/mozgtk/mozgtk.c
-@@ -4,10 +4,17 @@
- * 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 "mozilla/Types.h"
-
-+#include <gdk/gdk.h>
-+
-+// Dummy call to gtk3 library to prevent the linker from removing
-+// the gtk3 dependency with --as-needed.
-+// see toolkit/library/moz.build for details.
-+MOZ_EXPORT void mozgtk_linker_holder() { gdk_display_get_default(); }
-+
- #ifdef MOZ_X11
- # include <X11/Xlib.h>
- // Bug 1271100
- // We need to trick system Cairo into not using the XShm extension due to
- // a race condition in it that results in frequent BadAccess errors. Cairo
-diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
---- a/widget/gtk/nsWindow.cpp
-+++ b/widget/gtk/nsWindow.cpp
-@@ -266,10 +266,13 @@
- return sTimeConverterSingleton;
- }
-
- bool nsWindow::sTransparentMainWindow = false;
-
-+// forward declare from mozgtk
-+extern "C" MOZ_EXPORT void mozgtk_linker_holder();
-+
- namespace mozilla {
-
- #ifdef MOZ_X11
- class CurrentX11TimeGetter {
- public:
-@@ -426,10 +429,14 @@
- do_GetService("@mozilla.org/widget/clipboard;1");
- NS_ASSERTION(clipboard, "Failed to init clipboard!");
- }
- #endif
- }
-+ // Dummy call to mozgtk to prevent the linker from removing
-+ // the dependency with --as-needed.
-+ // see toolkit/library/moz.build for details.
-+ mozgtk_linker_holder();
- }
-
- nsWindow::~nsWindow() {
- LOG("nsWindow::~nsWindow()");
-
-@@ -5332,14 +5339,10 @@
- //
- // If the window were to get unredirected, there could be visible
- // tearing because Gecko does not align its framebuffer updates with
- // vblank.
- SetCompositorHint(GTK_WIDGET_COMPOSIDED_ENABLED);
--
-- // Dummy call to a function in mozgtk to prevent the linker from
removing
-- // the dependency with --as-needed.
-- XShmQueryExtension(DefaultXDisplay());
- }
- #endif
- #ifdef MOZ_WAYLAND
- if (GdkIsWaylandDisplay()) {
- mSurfaceProvider.Initialize(this);
-
diff --git
a/http/firefox/patches/0043-p02-bmo-1772721-build-wayland-only.patch
b/http/firefox/patches/0043-p02-bmo-1772721-build-wayland-only.patch
deleted file mode 100644
index 63907fd..0000000
--- a/http/firefox/patches/0043-p02-bmo-1772721-build-wayland-only.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Naur a/widget/gtk/mozgtk/mozgtk.c b/widget/gtk/mozgtk/mozgtk.c
---- a/widget/gtk/mozgtk/mozgtk.c 2022-06-18 19:17:31.464160229 -0000
-+++ b/widget/gtk/mozgtk/mozgtk.c 2022-06-18 19:24:34.966749520 -0000
-@@ -8,6 +8,8 @@
-
- #include <gdk/gdk.h>
-
-+MOZ_EXPORT unsigned int gtk_get_debug_flags(void) { return 0; }
-+
- // Dummy call to gtk3 library to prevent the linker from removing
- // the gtk3 dependency with --as-needed.
- // see toolkit/library/moz.build for details.
-diff -Naur a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
---- a/widget/gtk/nsWindow.cpp 2022-06-18 19:17:31.464160229 -0000
-+++ b/widget/gtk/nsWindow.cpp 2022-06-18 19:26:47.689851900 -0000
-@@ -5312,6 +5312,9 @@
- SetCompositorHint(GTK_WIDGET_COMPOSIDED_ENABLED);
- }
- #endif
-+// Dummy call to a function in mozgtk to prevent the linker from removing
-+// the dependency with --as-needed.
-+gtk_get_debug_flags();
- #ifdef MOZ_WAYLAND
- if (GdkIsWaylandDisplay()) {
- mSurfaceProvider.Initialize(this);
diff --git
a/http/firefox/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
b/http/firefox/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
deleted file mode 100644
index 6caf6eb..0000000
---
a/http/firefox/patches/0044-p03-bmo-1772513-build-wayland-only-D148256.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-diff --git a/widget/gtk/CompositorWidgetParent.cpp
b/widget/gtk/CompositorWidgetParent.cpp
---- a/widget/gtk/CompositorWidgetParent.cpp
-+++ b/widget/gtk/CompositorWidgetParent.cpp
-@@ -4,13 +4,13 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "CompositorWidgetParent.h"
- #include "mozilla/Unused.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
-+#include "nsWindow.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- CompositorWidgetParent::CompositorWidgetParent(
- const CompositorWidgetInitData& aInitData,
- const layers::CompositorOptions& aOptions)
- : GtkCompositorWidget(aInitData.get_GtkCompositorWidgetInitData(),
aOptions,
-@@ -49,7 +49,6 @@
- const uintptr_t& aXWindow, const bool& aShaped) {
- EnableRendering(aXWindow, aShaped);
- return IPC_OK();
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/GtkCompositorWidget.cpp
b/widget/gtk/GtkCompositorWidget.cpp
---- a/widget/gtk/GtkCompositorWidget.cpp
-+++ b/widget/gtk/GtkCompositorWidget.cpp
-@@ -3,10 +3,11 @@
- * 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 "GtkCompositorWidget.h"
-
-+#include "mozilla/gfx/gfxVars.h"
- #include "mozilla/layers/CompositorThread.h"
- #include "mozilla/widget/InProcessCompositorWidget.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
- #include "nsWindow.h"
-
-diff --git a/widget/gtk/IMContextWrapper.cpp
b/widget/gtk/IMContextWrapper.cpp
---- a/widget/gtk/IMContextWrapper.cpp
-+++ b/widget/gtk/IMContextWrapper.cpp
-@@ -5,10 +5,11 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #include "mozilla/Logging.h"
- #include "nsString.h"
- #include "prtime.h"
-+#include "prenv.h"
-
- #include "IMContextWrapper.h"
- #include "nsGtkKeyUtils.h"
- #include "nsWindow.h"
- #include "mozilla/AutoRestore.h"
-diff --git a/widget/gtk/InProcessGtkCompositorWidget.cpp
b/widget/gtk/InProcessGtkCompositorWidget.cpp
---- a/widget/gtk/InProcessGtkCompositorWidget.cpp
-+++ b/widget/gtk/InProcessGtkCompositorWidget.cpp
-@@ -6,14 +6,14 @@
- #include "HeadlessCompositorWidget.h"
- #include "HeadlessWidget.h"
- #include "mozilla/widget/PlatformWidgetTypes.h"
-
- #include "InProcessGtkCompositorWidget.h"
-+#include "VsyncDispatcher.h"
- #include "nsWindow.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- /* static */
- RefPtr<CompositorWidget> CompositorWidget::CreateLocal(
- const CompositorWidgetInitData& aInitData,
- const layers::CompositorOptions& aOptions, nsIWidget* aWidget) {
-@@ -39,7 +39,6 @@
- mWidget->GetCompositorVsyncDispatcher()) {
- cvd->SetCompositorVsyncObserver(aObserver);
- }
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/MPRISServiceHandler.cpp
b/widget/gtk/MPRISServiceHandler.cpp
---- a/widget/gtk/MPRISServiceHandler.cpp
-+++ b/widget/gtk/MPRISServiceHandler.cpp
-@@ -10,10 +10,11 @@
- #include <inttypes.h>
- #include <unordered_map>
-
- #include "MPRISInterfaceDescription.h"
- #include "mozilla/dom/MediaControlUtils.h"
-+#include "mozilla/GRefPtr.h"
- #include "mozilla/GUniquePtr.h"
- #include "mozilla/UniquePtrExtensions.h"
- #include "mozilla/Maybe.h"
- #include "mozilla/ScopeExit.h"
- #include "mozilla/Sprintf.h"
-diff --git a/widget/gtk/WindowSurfaceX11.h b/widget/gtk/WindowSurfaceX11.h
---- a/widget/gtk/WindowSurfaceX11.h
-+++ b/widget/gtk/WindowSurfaceX11.h
-@@ -11,13 +11,13 @@
-
- # include "mozilla/widget/WindowSurface.h"
- # include "mozilla/gfx/Types.h"
-
- # include <X11/Xlib.h>
-+# include "X11UndefineNone.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- class WindowSurfaceX11 : public WindowSurface {
- public:
- WindowSurfaceX11(Display* aDisplay, Window aWindow, Visual* aVisual,
- unsigned int aDepth);
-@@ -31,10 +31,9 @@
- Visual* const mVisual;
- const unsigned int mDepth;
- const gfx::SurfaceFormat mFormat;
- };
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-
- #endif // MOZ_X11
- #endif // _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_H
-diff --git a/widget/gtk/WindowSurfaceX11.cpp
b/widget/gtk/WindowSurfaceX11.cpp
---- a/widget/gtk/WindowSurfaceX11.cpp
-+++ b/widget/gtk/WindowSurfaceX11.cpp
-@@ -4,14 +4,12 @@
- * 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 "WindowSurfaceX11.h"
- #include "gfxPlatform.h"
--#include "X11UndefineNone.h"
-
--namespace mozilla {
--namespace widget {
-+namespace mozilla::widget {
-
- WindowSurfaceX11::WindowSurfaceX11(Display* aDisplay, Window aWindow,
- Visual* aVisual, unsigned int aDepth)
- : mDisplay(aDisplay),
- mWindow(aWindow),
-@@ -44,7 +42,6 @@
- }
-
- return gfx::SurfaceFormat::UNKNOWN;
- }
-
--} // namespace widget
--} // namespace mozilla
-+} // namespace mozilla::widget
-diff --git a/widget/gtk/nsApplicationChooser.cpp
b/widget/gtk/nsApplicationChooser.cpp
---- a/widget/gtk/nsApplicationChooser.cpp
-+++ b/widget/gtk/nsApplicationChooser.cpp
-@@ -9,10 +9,11 @@
-
- #include "nsApplicationChooser.h"
- #include "WidgetUtils.h"
- #include "nsIMIMEInfo.h"
- #include "nsIWidget.h"
-+#include "nsIFile.h"
- #include "nsCExternalHandlerService.h"
- #include "nsComponentManagerUtils.h"
- #include "nsGtkUtils.h"
- #include "nsPIDOMWindow.h"
-
-diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp
---- a/widget/gtk/nsClipboard.cpp
-+++ b/widget/gtk/nsClipboard.cpp
-@@ -29,10 +29,11 @@
- #include "nsStringStream.h"
- #include "nsIFileURL.h"
- #include "nsIObserverService.h"
- #include "mozilla/Services.h"
- #include "mozilla/RefPtr.h"
-+#include "mozilla/GRefPtr.h"
- #include "mozilla/SchedulerGroup.h"
- #include "mozilla/StaticPrefs_widget.h"
- #include "mozilla/TimeStamp.h"
- #include "WidgetUtilsGtk.h"
-
-diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h
---- a/widget/gtk/nsGtkKeyUtils.h
-+++ b/widget/gtk/nsGtkKeyUtils.h
-@@ -18,10 +18,11 @@
- #endif
- #ifdef MOZ_WAYLAND
- # include <gdk/gdkwayland.h>
- # include <xkbcommon/xkbcommon.h>
- #endif
-+#include "X11UndefineNone.h"
-
- class nsWindow;
-
- namespace mozilla {
- namespace widget {
-
diff --git
a/http/firefox/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
b/http/firefox/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
deleted file mode 100644
index e6696a4..0000000
---
a/http/firefox/patches/0045-p04-bmo-1772513-build-wayland-only-D148257.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
---- a/widget/gtk/moz.build
-+++ b/widget/gtk/moz.build
-@@ -185,8 +185,7 @@
- ]
- UNIFIED_SOURCES += [
- "AsyncDBus.cpp",
- ]
- CXXFLAGS += CONFIG["MOZ_DBUS_GLIB_CFLAGS"]
-+
- CXXFLAGS += ["-Werror=switch"]
--
--REQUIRES_UNIFIED_BUILD = True
-
diff --git
a/http/firefox/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
b/http/firefox/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
deleted file mode 100644
index 1c27926..0000000
---
a/http/firefox/patches/0046-p05-bmo-1776724-build-wayland-only-D150485.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/gfx/gl/GLContextProviderEGL.cpp
b/gfx/gl/GLContextProviderEGL.cpp
---- a/gfx/gl/GLContextProviderEGL.cpp
-+++ b/gfx/gl/GLContextProviderEGL.cpp
-@@ -77,10 +77,11 @@
- #if defined(MOZ_WIDGET_GTK)
- # include "mozilla/widget/GtkCompositorWidget.h"
- # if defined(MOZ_WAYLAND)
- # include <gdk/gdkwayland.h>
- # include <wayland-egl.h>
-+# include "mozilla/WidgetUtilsGtk.h"
- # include "mozilla/widget/nsWaylandDisplay.h"
- # endif
- #endif
-
- struct wl_egl_window;
-diff --git a/gfx/gl/GLContextProviderLinux.cpp
b/gfx/gl/GLContextProviderLinux.cpp
---- a/gfx/gl/GLContextProviderLinux.cpp
-+++ b/gfx/gl/GLContextProviderLinux.cpp
-@@ -11,49 +11,59 @@
- namespace mozilla::gl {
-
- using namespace mozilla::gfx;
- using namespace mozilla::widget;
-
-+#ifdef MOZ_X11
- static class GLContextProviderGLX sGLContextProviderGLX;
-+#endif
- static class GLContextProviderEGL sGLContextProviderEGL;
-
- already_AddRefed<GLContext>
GLContextProviderLinux::CreateForCompositorWidget(
- CompositorWidget* aCompositorWidget, bool aHardwareWebRender,
- bool aForceAccelerated) {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.CreateForCompositorWidget(
- aCompositorWidget, aHardwareWebRender, aForceAccelerated);
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.CreateForCompositorWidget(
- aCompositorWidget, aHardwareWebRender, aForceAccelerated);
-+#endif
- }
- }
-
- /*static*/
- already_AddRefed<GLContext> GLContextProviderLinux::CreateHeadless(
- const GLContextCreateDesc& desc, nsACString* const out_failureId) {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.CreateHeadless(desc, out_failureId);
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.CreateHeadless(desc, out_failureId);
-+#endif
- }
- }
-
- /*static*/
- GLContext* GLContextProviderLinux::GetGlobalContext() {
- if (gfxVars::UseEGL()) {
- return sGLContextProviderEGL.GetGlobalContext();
-+#ifdef MOZ_X11
- } else {
- return sGLContextProviderGLX.GetGlobalContext();
-+#endif
- }
- }
-
- /*static*/
- void GLContextProviderLinux::Shutdown() {
- if (gfxVars::UseEGL()) {
- sGLContextProviderEGL.Shutdown();
-+#ifdef MOZ_X11
- } else {
- sGLContextProviderGLX.Shutdown();
-+#endif
- }
- }
-
- } // namespace mozilla::gl
-diff --git a/gfx/gl/moz.build b/gfx/gl/moz.build
---- a/gfx/gl/moz.build
-+++ b/gfx/gl/moz.build
-@@ -105,14 +105,15 @@
-
- elif gl_provider == "Linux":
- # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
- # as it includes X11 headers which cause conflicts.
- SOURCES += [
-- "GLContextProviderGLX.cpp",
- "GLContextProviderLinux.cpp",
- ]
- EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
-+ if CONFIG["MOZ_X11"]:
-+ SOURCES += ["GLContextProviderGLX.cpp"]
-
- if CONFIG["MOZ_WAYLAND"]:
- SOURCES += ["SharedSurfaceDMABUF.cpp"]
-
- UNIFIED_SOURCES += [
-diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
---- a/gfx/thebes/gfxPlatformGtk.cpp
-+++ b/gfx/thebes/gfxPlatformGtk.cpp
-@@ -991,11 +991,11 @@
- }
-
- RefPtr<VsyncSource> softwareVsync = new XrandrSoftwareVsyncSource();
- return softwareVsync.forget();
- #else
-- return CreateSoftwareVsyncSource();
-+ return GetSoftwareVsyncSource();
- #endif
- }
-
- void gfxPlatformGtk::BuildContentDeviceData(ContentDeviceData* aOut) {
- gfxPlatform::BuildContentDeviceData(aOut);
-
diff --git
a/http/firefox/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
b/http/firefox/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
deleted file mode 100644
index 634892be..0000000
--- a/http/firefox/patches/0047-bmo-1754469-memory_mozalloc_throw.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC
-+++ b/memory/mozalloc/throw_gcc.h
-@@ -74,50 +74,66 @@ __throw_bad_function_call(void) {
- mozalloc_abort("fatal: STL threw bad_function_call");
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_logic_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_domain_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_invalid_argument(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_length_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_out_of_range(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_runtime_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_range_error(
- const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_overflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
-+#if !defined(_LIBCPP_VERSION)
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
- __throw_underflow_error(const char* msg) {
- mozalloc_abort(msg);
- }
-+#endif // _LIBCPP_VERSION
-
- MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void
__throw_ios_failure(
- const char* msg) {
diff --git
a/http/firefox/patches/0048-bmo-1769631-python-3.11-compatibility.patch
b/http/firefox/patches/0048-bmo-1769631-python-3.11-compatibility.patch
deleted file mode 100644
index 8dcd0e2..0000000
--- a/http/firefox/patches/0048-bmo-1769631-python-3.11-compatibility.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-
-# HG changeset patch
-# User ahochheiden <ahochheiden AT mozilla.com>
-# Date 1654151264 0
-# Node ID f54162b2c1f2fe52c6137ab2c3469a1944f58b27
-# Parent 6e7776492240c27732840d65a33dcc440fa1aba0
-Bug 1769631 - Remove 'U' from 'mode' parameters for various 'open' calls to
ensure Python3.11 compatibility r=firefox-build-system-reviewers,glandium
-
-The 'U' flag represents "universal newline". It has been deprecated
-since Python3.3. Since then "universal newline" is the default when a
-file is opened in text mode (not bytes). In Python3.11 using the 'U'
-flag throws errors. There should be no harm in removing 'U' from 'open'
-everywhere it is used, and doing allows the use of Python3.11.
-
-For more reading see:
https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api
-
-Differential Revision: https://phabricator.services.mozilla.com/D147721
-
-diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py
---- a/dom/base/usecounters.py
-+++ b/dom/base/usecounters.py
-@@ -3,17 +3,17 @@
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
- import collections
- import re
-
-
- def read_conf(conf_filename):
- # Can't read/write from a single StringIO, so make a new one for
reading.
-- stream = open(conf_filename, "rU")
-+ stream = open(conf_filename, "r")
-
- def parse_counters(stream):
- for line_num, line in enumerate(stream):
- line = line.rstrip("\n")
- if not line or line.startswith("//"):
- # empty line or comment
- continue
- m = re.match(r"method ([A-Za-z0-9]+)\.([A-Za-z0-9]+)$", line)
-diff --git a/python/mozbuild/mozbuild/action/process_define_files.py
b/python/mozbuild/mozbuild/action/process_define_files.py
---- a/python/mozbuild/mozbuild/action/process_define_files.py
-+++ b/python/mozbuild/mozbuild/action/process_define_files.py
-@@ -31,17 +31,17 @@ def process_define_file(output, input):
-
- config = PartialConfigEnvironment(topobjdir)
-
- if mozpath.basedir(
- path, [mozpath.join(topsrcdir, "js/src")]
- ) and not config.substs.get("JS_STANDALONE"):
- config = PartialConfigEnvironment(mozpath.join(topobjdir, "js",
"src"))
-
-- with open(path, "rU") as input:
-+ with open(path, "r") as input:
- r = re.compile(
-
"^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
- )
- for l in input:
- m = r.match(l)
- if m:
- cmd = m.group("cmd")
- name = m.group("name")
-diff --git a/python/mozbuild/mozbuild/backend/base.py
b/python/mozbuild/mozbuild/backend/base.py
---- a/python/mozbuild/mozbuild/backend/base.py
-+++ b/python/mozbuild/mozbuild/backend/base.py
-@@ -267,17 +267,17 @@ class BuildBackend(LoggingMixin):
- If an exception is raised, |mach build| will fail with a
- non-zero exit code.
- """
- self._write_purgecaches(config)
-
- return status
-
- @contextmanager
-- def _write_file(self, path=None, fh=None, readmode="rU"):
-+ def _write_file(self, path=None, fh=None, readmode="r"):
- """Context manager to write a file.
-
- This is a glorified wrapper around FileAvoidWrite with integration
to
- update the summary data on this instance.
-
- Example usage:
-
- with self._write_file('foo.txt') as fh:
-diff --git a/python/mozbuild/mozbuild/preprocessor.py
b/python/mozbuild/mozbuild/preprocessor.py
---- a/python/mozbuild/mozbuild/preprocessor.py
-+++ b/python/mozbuild/mozbuild/preprocessor.py
-@@ -526,17 +526,17 @@ class Preprocessor:
- if not options.output:
- raise Preprocessor.Error(
- self, "--depend doesn't work with stdout", None
- )
- depfile = get_output_file(options.depend)
-
- if args:
- for f in args:
-- with io.open(f, "rU", encoding="utf-8") as input:
-+ with io.open(f, "r", encoding="utf-8") as input:
- self.processFile(input=input, output=out)
- if depfile:
- mk = Makefile()
-
mk.create_rule([six.ensure_text(options.output)]).add_dependencies(
- self.includes
- )
- mk.dump(depfile)
- depfile.close()
-@@ -855,17 +855,17 @@ class Preprocessor:
- self.checkLineNumbers = False
- if isName:
- try:
- args = _to_text(args)
- if filters:
- args = self.applyFilters(args)
- if not os.path.isabs(args):
- args = os.path.join(self.curdir, args)
-- args = io.open(args, "rU", encoding="utf-8")
-+ args = io.open(args, "r", encoding="utf-8")
- except Preprocessor.Error:
- raise
- except Exception:
- raise Preprocessor.Error(self, "FILE_NOT_FOUND",
_to_text(args))
- self.checkLineNumbers = bool(
- re.search("\.(js|jsm|java|webidl)(?:\.in)?$", args.name)
- )
- oldFile = self.context["FILE"]
-@@ -909,17 +909,17 @@ class Preprocessor:
-
- def do_error(self, args):
- raise Preprocessor.Error(self, "Error: ", _to_text(args))
-
-
- def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout,
marker="#"):
- pp = Preprocessor(defines=defines, marker=marker)
- for f in includes:
-- with io.open(f, "rU", encoding="utf-8") as input:
-+ with io.open(f, "r", encoding="utf-8") as input:
- pp.processFile(input=input, output=output)
- return pp.includes
-
-
- # Keep this module independently executable.
- if __name__ == "__main__":
- pp = Preprocessor()
- pp.handleCommandLine(None, True)
-diff --git a/python/mozbuild/mozbuild/util.py
b/python/mozbuild/mozbuild/util.py
---- a/python/mozbuild/mozbuild/util.py
-+++ b/python/mozbuild/mozbuild/util.py
-@@ -231,17 +231,17 @@ class FileAvoidWrite(BytesIO):
- enabled by default because it a) doesn't make sense for binary files b)
- could add unwanted overhead to calls.
-
- Additionally, there is dry run mode where the file is not actually
written
- out, but reports whether the file was existing and would have been
updated
- still occur, as well as diff capture if requested.
- """
-
-- def __init__(self, filename, capture_diff=False, dry_run=False,
readmode="rU"):
-+ def __init__(self, filename, capture_diff=False, dry_run=False,
readmode="r"):
- BytesIO.__init__(self)
- self.name = filename
- assert type(capture_diff) == bool
- assert type(dry_run) == bool
- assert "r" in readmode
- self._capture_diff = capture_diff
- self._write_to_file = not dry_run
- self.diff = None
-diff --git a/python/mozbuild/mozpack/files.py
b/python/mozbuild/mozpack/files.py
---- a/python/mozbuild/mozpack/files.py
-+++ b/python/mozbuild/mozpack/files.py
-@@ -549,17 +549,17 @@ class PreprocessedFile(BaseFile):
- self.defines = defines
- self.extra_depends = list(extra_depends or [])
- self.silence_missing_directive_warnings =
silence_missing_directive_warnings
-
- def inputs(self):
- pp = Preprocessor(defines=self.defines, marker=self.marker)
-
pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
-
-- with _open(self.path, "rU") as input:
-+ with _open(self.path, "r") as input:
- with _open(os.devnull, "w") as output:
- pp.processFile(input=input, output=output)
-
- # This always yields at least self.path.
- return pp.includes
-
- def copy(self, dest, skip_if_older=True):
- """
-@@ -606,17 +606,17 @@ class PreprocessedFile(BaseFile):
- return False
-
- deps_out = None
- if self.depfile:
- deps_out = FileAvoidWrite(self.depfile)
- pp = Preprocessor(defines=self.defines, marker=self.marker)
-
pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
-
-- with _open(self.path, "rU") as input:
-+ with _open(self.path, "r") as input:
- pp.processFile(input=input, output=dest, depfile=deps_out)
-
- dest.close()
- if self.depfile:
- deps_out.close()
-
- return True
-
-



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (b616cc6b9c4bdd82b12b4508a40c146581dc9264), Pavel Vinogradov, 07/26/2022

Archive powered by MHonArc 2.6.24.

Top of Page